public async Task <IHttpActionResult> DeletePhonebookEntry(int id) { if (ModelState.IsValid) { var response = await PhonebookService.DeletePhonebookEntry(id); return(Ok(response)); } return(BadRequest(ModelState)); }
public async Task <IHttpActionResult> DeletePhonebookEntry(int id) { var entry = await PhonebookService.GetSinglePhonebookEntry(id); if (entry == null) { return(NotFound()); } await PhonebookService.DeletePhonebookEntry(id); return(Ok(entry)); }