public async Task <IActionResult> DeleteContrato(int?id) { if (id.HasValue) { Contrato contrato = await contratoDAO.GetById(id); await contratoDAO.Remove(contrato); return(RedirectToAction("Index")); } HttpContext.Response.StatusCode = 400; return(RedirectToAction("Index")); }