public async Task <IActionResult> Deletar(int id) { try { await _vendedorServico.RemoveAsync(id); return(RedirectToAction(nameof(Index))); } catch (IntegrandoExecao e) { return(RedirectToAction(nameof(Error), new { message = e.Message })); } }
public async Task <IActionResult> Delete(int Id) { try { await _vendedorServico.RemoveAsync(Id); return(RedirectToAction(nameof(Index))); } catch (ErroDeIntegridade e) { return(RedirectToAction(nameof(Error), new { message = e.Message })); } }