Ejemplo n.º 1
0
 public static DateTime GetSnapshotTimestamp()
 {
     using (LiteDatabase db = HostRoot.CreateReportDb()) {
         var col = db.GetCollection <SnapshotTimestamp>();
         SnapshotTimestamp entity = col.FindById(1);
         if (entity == null)
         {
             return(HostRoot.Current.ClientCoinSnapshotSet.GetMinTimestamp());
         }
         return(entity.Timestamp);
     }
 }
Ejemplo n.º 2
0
 public static void SetSnapshotTimestamp(DateTime timestamp)
 {
     using (LiteDatabase db = HostRoot.CreateReportDb()) {
         var col = db.GetCollection <SnapshotTimestamp>();
         SnapshotTimestamp entity = col.FindById(1);
         if (entity == null)
         {
             col.Insert(new SnapshotTimestamp {
                 Id        = 1,
                 Timestamp = timestamp
             });
         }
         else
         {
             entity.Timestamp = timestamp;
             col.Update(entity);
         }
     }
 }