Esempio n. 1
0
 public string CreateTick(string key)
 {
     var tick = ObjectId.NewObjectId().ToString();
     var spamHash = new SpamHash
     {
         Id = tick,
         PostKey = key,
         CreatedTime = DateTime.UtcNow
     };
     _db.Insert(DBTableNames.SpamHashes, spamHash);
     return tick;
 }
 public string CreateTick(string key)
 {
     using (var _db = new LiteDatabase(_dbConfig.DbPath))
     {
         var tick = ObjectId.NewObjectId().ToString();
         var spamHash = new SpamHash
         {
             Id = tick,
             PostKey = key,
             CreatedTime = DateTime.UtcNow
         };
         var spamHashCol = _db.GetCollection<SpamHash>(DBTableNames.SpamHashes);
         spamHashCol.Insert(spamHash);
         return tick;
     }
 }