Задайте вопросЗадайте вопрос
 

ОтвеченоHow to filter Include in ObjectQuery

  • 7 мая 2009 г. 20:13Dynamic Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Background:
    ObjectQuery<Customer> myCollection = myEntityFrameworkContext.Customer.Include("Order.OrderDetail");

    (Each Customer has a collection of Order objects and each Order has a collection of OrderDetail objects)

    Question
    How can I filter the result or change the query in a way that only those resultsets are returned where OrderDetail with the productId = 2.

    something like this: myEntityFrameworkContext.Customer.Include("Order.OrderDetails").Where("it.Order.OrderDetail.productId = 2")

    Any help is much appreciated.

Ответы

Все ответы