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