Exemple #1
0
 public static Order GetOrder(string id)
 {
     using (var db = new OrderContext()) {
         return(AllOrders(db).FirstOrDefault(o => o.Id == id));
     }
 }
Exemple #2
0
 private static IQueryable <Order> AllOrders(OrderContext db)
 {
     return(db.Orders.Include(o => o.Items.Select(i => i.GoodsItem))
            .Include("Customer"));
 }
Exemple #3
0
 public static List <Order> GetAllOrders()
 {
     using (var db = new OrderContext()) {
         return(AllOrders(db).ToList());
     }
 }
 public static List <Goods> GetAll()
 {
     using (var db = new OrderContext()) {
         return(db.GoodItems.ToList());
     }
 }