コード例 #1
0
 public bool CheckSession(string sessionValue)
 {
     using (var context = new ChatDemoAppEntities()) {
         var checkSession = context.ChatApps.FirstOrDefault(x => x.ChatSession == sessionValue.Trim()) != null;
         return(checkSession);
     }
 }
コード例 #2
0
 public void SaveSession(string name, string sessionId)
 {
     // Call the addNewMessageToPage method to update clients.
     using (var context = new ChatDemoAppEntities()) {
         var chatTbl = new ChatApp
         {
             ChatSession = sessionId,
             UserName    = name
         };
         context.ChatApps.Add(chatTbl);
         context.SaveChanges();
     }
 }