public ActionResult Delete(long id, string control) { ContactInformation myContactInformation = _contactInformationRepository.GetById(id); long ID = myContactInformation.People.Id; _contactInformationRepository.Delete(id); const string title = "Informacion Eliminada"; _viewMessageLogic.SetNewMessage(title, "", ViewMessageType.SuccessMessage); return(RedirectToAction("Details/" + ID, control)); }
public IActionResult DeleteContactDetail([FromRoute] int id) { try { _contactInformationRepository.Delete(id); return(Ok(new { Message = "Contact information deleted successfully" })); } catch (Exception ex) { return(BadRequest(new { Message = ex.Message })); } }