static OrderSet SharedLoad() { OrderSet result = new OrderSet(); using (var ctx = new NWindDataContext()) { DataLoadOptions options = new DataLoadOptions(); options.LoadWith<Order>(order => order.Order_Details); ctx.LoadOptions = options; result.Orders.AddRange(ctx.Orders); } return result; }
static OrderSet SharedLoad() { OrderSet result = new OrderSet(); using (var ctx = new NWindDataContext()) { DataLoadOptions options = new DataLoadOptions(); options.LoadWith <Order>(order => order.Order_Details); ctx.LoadOptions = options; result.Orders.AddRange(ctx.Orders); } return(result); }