Beispiel #1
0
 public Task StoreChatHistoryAsync(Say say)
 {
     return(Task.Run(async() =>
     {
         await storeHistorySemaphore.WaitAsync();
         try
         {
             using (var db = new ZkDataContext())
             {
                 var historyEntry = new LobbyChatHistory();
                 historyEntry.SetFromSay(say);
                 db.LobbyChatHistories.Add(historyEntry);
                 db.SaveChanges();
             }
         }
         catch (Exception ex)
         {
             Trace.TraceError("Error saving chat history: {0}", ex);
         }
         finally
         {
             storeHistorySemaphore.Release();
         }
     }));
 }
Beispiel #2
0
 public async Task StoreChatHistory(Say say)
 {
     using (var db = new ZkDataContext()) {
         var historyEntry = new LobbyChatHistory();
         historyEntry.SetFromSay(say);
         db.LobbyChatHistories.Add(historyEntry);
         await db.SaveChangesAsync();
     }
 }