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