I have the following databases:

and the following code:
public IActionResult Index(IssueModel searchCriteria)
{
var bloods = from m in _context.Blood
select m;
if (!string.IsNullOrEmpty(searchCriteria.SearchComponent))
{
//Blood Component
bloods = bloods.Where(s => s.Component.Contains(searchCriteria.SearchComponent));
//Blood Type : This is where I plan to search for a specific blood type.
}
return View(bloods);
}
As you can see, I'm happy to search the blood database for a certain component type. In the area I've marked I would like to search for blood that relates to a certain PlasType or RedBloodType.
Any ideas? Thanks!
Edit: Thanks to everyone who offered an answer. All the answers I've looked at have been incredibly useful not just in helping me crack this one, but improve my understanding of the topic.
returnstatement ignoresbloodsis unhelpful... but moreover, you haven't really asked a question yet. What exactly are you stuck on?blood.DonorId, you could find theDonorwhich matches yourPlasmaTypeandRedBloodTypecriteria. Then, return the result of the query, not the original_context.Blood.List