So, I got something like this:
var myObj = db.SomeObject
.Include("Tasks")
.SingleOrDefault(x => x.Id == someObjectId);
if (myObj != null)
{
myObj.Tasks = myObj.Tasks.OrderBy(x => x.Number).ToList();
}
Here I want to be able to include condition ( where) in my Include, for example:
.where task.IsDeleted == false
So I did not find a solution.
I know that I could use wherealong with where I order tasks, but this, however, does not work in the database, but instead uses memory. I want it to run in the database.
Does anyone know how I can do this? If so, is there a way to include the condition order byin the list of tasks on the list?
source
share