Esempio n. 1
0
 public TwitterMessage CreateTwitterMessage(string text)
 {
     lock (_dbLock)
     {
         var twm = new TwitterMessage {
             Text = text, CreateDate = DateTime.Now
         };
         _db.Add(twm);
         _db.SaveChanges();
         return(twm);
     }
 }
Esempio n. 2
0
 public void SaveMessage(Message message)
 {
     using var db = new TezosDataContext(_dbOptions);
     db.Add(message);
     db.SaveChanges();
 }