示例#1
0
 public bool IsContactAlreadyExist(AccountDTO owner, AccountDTO contact)
 {
     return(context.Contacts.ToList().Contains(context.Contacts.ToList().Where(x => x.OwnerId == owner.Id & x.ContactId == contact.Id).FirstOrDefault()));
 }
示例#2
0
 public void DeleteContact(AccountDTO owner, AccountDTO contact)
 {
     context.Contacts.Remove(context.Contacts.Where(x => x.OwnerId == owner.Id & x.ContactId == contact.Id).FirstOrDefault());
     context.SaveChanges();
 }