public async Task <IActionResult> DeletetrustedContact(long id) { var trustedContact = _db.TrustedContact.Where(_ => _.Id == id).FirstOrDefault(); if (trustedContact == null) { return(NotFound()); } _db.TrustedContact.Remove(trustedContact); _db.SaveChanges(); return(Ok()); }
public string DeletetrustedContact(long id) { TrustedContact trustedContact = _db.TrustedContact.Find(id); _db.TrustedContact.Remove(trustedContact); _db.SaveChanges(); return("OK"); //var trustedContact = _db.TrustedContact.Where(_ => _.Id == id).FirstOrDefault(); //if (trustedContact == null) return NotFound(); //_db.TrustedContact.Remove(trustedContact); //_db.SaveChanges(); //return Ok(); }