silverlight - RIA Service ObjectContext filter included records -
using ria domain services entity framework 4, having trouble entity filtered related items.
for example, given: order table , product table (1 order has many products)
i have service returns order products loaded, e.g.
public iqueryable<order> getorderbyid(int orderid) { return this.objectcontext.order .include("products") .where(n=>n.orderid == orderid); }
question,
is there way filter products record in linq query in case? say, return order of specified id , include products prices higher 100.0; return empty/null products if there isn't any. point here return order though there isn't products meet criteria.
have tried this:
var query = o in objectcontext.order.include("products") join p in objectcontext.product on o.productid equals p.productid o.orderid == orderid , p.price > 100 select o;
Comments
Post a Comment