예제 #1
0
 public void addNewContact(Contact contact)
 {
     if (contact == null)
     {
         return;
     }
     using (var db = new myMailContext())
     {
         db.Contacts.Add(contact);
         db.SaveChanges();
     }
 }
예제 #2
0
 public void removeMessage(Message message)
 {
     if (message == null)
     {
         return;
     }
     using (var db = new myMailContext())
     {
         db.Messages.Attach(message);
         db.Messages.Remove(message);
         db.SaveChanges();
     }
 }
예제 #3
0
 public void removeContact(Contact contact)
 {
     if (contact == null)
     {
         return;
     }
     using (var db = new myMailContext())
     {
         db.Contacts.Attach(contact);
         db.Contacts.Remove(contact);
         db.SaveChanges();
     }
 }