Esempio n. 1
0
 public virtual void SaveStatus(Order order)
 {
     using (var context = new PaymentContext())
     {
         context.Set <Order>().Single(o => o.Id == order.Id).Status = order.Status;
         context.SaveChanges();
     }
 }
Esempio n. 2
0
 public virtual Order GetBy(Guid orderId)
 {
     using (var context = new PaymentContext())
         return(context.Set <Order>().SingleOrDefault(o => o.Id == orderId));
 }
Esempio n. 3
0
 public virtual Order GetRandom()
 {
     using (var context = new PaymentContext())
         return(context.Set <Order>().OrderBy(o => Guid.NewGuid()).FirstOrDefault());
 }
Esempio n. 4
0
 public virtual Order GetBy(Guid orderId, DateTime dateOfBirth)
 {
     using (var context = new PaymentContext())
         return(context.Set <Order>().Include(o => o.Items).SingleOrDefault(o =>
                                                                            o.Id == orderId && dateOfBirth.Date == DbFunctions.TruncateTime(o.DateOfBirth)));
 }