entity framework - REST interface to include referenced entities - .NET 4.5, MVC + EF -
let's have 2 entities: 1. order 2. package
each package has foreign key order, ie. 1 order has 1 or more packages. created rest interface able retrieve orders in json format.
public ienumerable<order> get() { using (dbcontext db = new dbcontext()) { return db.order.tolist(); } }
i wondering if there elegant way of including children packages in above json response, packages each order?
thanks
Comments
Post a Comment