예제 #1
0
 public BlogController()
 {
     try
     {
         messageContext = new MessageContext();
         messageEntities = messageContext.MessageEntities.ToList();
     }
     catch (Exception ex)
     {
       HelpFunction.GenerateEx(ex);
     }
 }
예제 #2
0
 public void AddMessage(string text)
 {
     try
     {
         messageContext = new MessageContext();
         MessageEntity message = new MessageEntity();
         message.Login = User.Identity.GetUserName();
         message.Message = text;
         message.Date = DateTime.Now;
         messageContext.MessageEntities.Load();
         messageContext.MessageEntities.Add(message);
         messageContext.SaveChanges();
     }
     catch (Exception ex)
     {
         HelpFunction.GenerateEx(ex);
     }
 }
예제 #3
0
 public HomeController()
 {
     var messageContext = new MessageContext();
      // messageContext.MessageEntities.Load();
     messageEntities = messageContext.MessageEntities.ToList();
 }