コード例 #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();
     }
 }
コード例 #2
0
 public virtual Order GetBy(Guid orderId)
 {
     using (var context = new PaymentContext())
         return(context.Set <Order>().SingleOrDefault(o => o.Id == orderId));
 }
コード例 #3
0
 public virtual Order GetRandom()
 {
     using (var context = new PaymentContext())
         return(context.Set <Order>().OrderBy(o => Guid.NewGuid()).FirstOrDefault());
 }
コード例 #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)));
 }