i have function
public Menu Details(int? id)
{
return _dataContext.Menu.Include("ChildMenu").FirstOrDefault(m => m.MenuId == id);
}
now i need to add condition to child list ChildMenu something like fieldname=id. how can i do it?
i have function
public Menu Details(int? id)
{
return _dataContext.Menu.Include("ChildMenu").FirstOrDefault(m => m.MenuId == id);
}
now i need to add condition to child list ChildMenu something like fieldname=id. how can i do it?
I'm not certain what you are trying to do, I think that the example might be better if it were split into two or three statements to break down the problem (it can be refactored into a single line when it is fixed).
If you could extend the question I'll try and help when I'm less tired.
return _dataContext.Menu.Include("ChildMenu").Where(m => m.MenuId == id && m.ChildMenu.IsDeleted == false).FirstOrDefault();