This question is locked. New answers and comments are not allowed.
Hi,
is it possible to filter the loaded navigation properties? I want to to set some entities as deleted and exclude them if I query over the navigation property.
var product = context.Products.Include(x=>x.OrderDetails.Where(od=>od.IsDeleted)).FirstOrDefault(x => x.ProductID == 1);
foreach (var orderDetail in product.OrderDetails)
{
Console.WriteLine(orderDetail.OrderID);
}
I can not filter on the foreach loop. it must be filtered before.
is it possible to filter the loaded navigation properties? I want to to set some entities as deleted and exclude them if I query over the navigation property.
var product = context.Products.Include(x=>x.OrderDetails.Where(od=>od.IsDeleted)).FirstOrDefault(x => x.ProductID == 1);
foreach (var orderDetail in product.OrderDetails)
{
Console.WriteLine(orderDetail.OrderID);
}
I can not filter on the foreach loop. it must be filtered before.