Esempio n. 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);
     }
 }
Esempio n. 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();
     }
 }