Пример #1
0
 public void UpdateTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr  = new GenericUpdater <Surveys, DateTime?>(sourceContext: dbcontext, destinationContext: dbOffcontext);
             var max = gr.GetMax(a => a.ModifiedOn);
             var c   = gr.GetToUpdateData(a => a.ModifiedOn, b => b.ModifiedOn != null && b.ModifiedOn > max, false);
         }
 }
Пример #2
0
 public void GenericMaxTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr = new GenericUpdater <Surveys, DateTime?>(dbcontext, dbOffcontext);
             var b  = gr.GetMax(a => a.ModifiedOn);
             Assert.AreEqual(1, 1);
         }
 }
Пример #3
0
 public void InsertTest()
 {
     using (var dbOffcontext = new AdbContext(DatabaseType.Sqlite))
         using (var dbcontext = new AdbContext())
         {
             var gr  = new GenericUpdater <Surveys, DateTime?>(sourceContext: dbcontext, destinationContext: dbOffcontext);
             var max = gr.GetMax(a => a.CreatedOn);
             var c   = gr.GetToUpdateData(a => a.CreatedOn, b => b.CreatedOn != null && b.CreatedOn > max, true);
             Assert.AreEqual(c, 1);
         }
 }