Пример #1
0
 public async Task SaveAsyncWithRetryTest()
 {
     using (var context = new DevTestContext())
     {
         var order = new Order
         {
             OrderNo = SequenceNoUtils.GenerateNo('O'),
             OrderAmount = 10000,
             ProductNo = "PN1001",
             UserNo = "UID1001"
         };
         await context.SaveAsync(order);
     }
 }
Пример #2
0
 public void SaveOrUpdateWithRetryTest()
 {
     using (var context = new DevTestContext())
     {
         var order = new Order
         {
             OrderNo = SequenceNoUtils.GenerateNo('O'),
             OrderAmount = 10000,
             ProductNo = "PN1001",
             UserNo = "UID1001"
         };
         context.Save(order);
         context.SaveOrUpdate(order, x => x.Id == order.Id);
     }
 }