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 put a condition (where) on my Include, for instance:
.where task.IsDeleted == false
Thusfar I have not found a solution.
I am aware of the fact that I could use the where together with where I order the tasks but this however, does not run on the database but in stead uses memory. I want it to run on the database.
Does anyone here know how I can do this?
If so, is there also a way to put the order by condition to the included list of tasks?