Beispiel #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);
        }
Beispiel #2
0
        public string CreateTick(string slug)
        {
            using (var db = new LiteDatabase(_dbConfig.DbPath))
            {
                var tick  = ObjectId.NewObjectId().ToString();
                var entry = new SpamHash
                {
                    Id          = tick,
                    PostKey     = slug,
                    CreatedTime = DateTime.UtcNow
                };

                var cols = db.GetCollection <SpamHash>(DBTableNames.SpamHashes);
                cols.Insert(entry);
                return(tick);
            }
        }