Пример #1
0
 public IEnumerable <EmailMessage> GetEmails()
 {
     using (DBAcessHandler DBAcessContext = new DBAcessHandler())
     {
         return(DBAcessContext.EmailMessages.ToList());
     }
 }
Пример #2
0
 public EmailMessage AddEmails(EmailMessage message)
 {
     message.Date = DateTime.Now;
     using (DBAcessHandler DBAcessContext = new DBAcessHandler())
     {
         DBAcessContext.Add(message);
         DBAcessContext.SaveChanges();
         return(message);
     }
 }