public async Task <IActionResult> Excluir(int id) { try { await _marca.ApagarAsync(id); return(RedirectToAction(nameof(Index))); } catch (IntegrityException e) { return(RedirectToAction(nameof(Error), new { message = e.Message })); } }