Example #1
0
        public async Task <IActionResult> Deletar(int id)
        {
            try {
                await _vendedorServico.RemoverAsync(id);

                return(RedirectToAction(nameof(Index)));
            } catch (IntegrityException e) {
                return(RedirectToAction(nameof(Erro), new { mensagem = e.Message }));
            }
        }
        public async Task <IActionResult> Delete(int Id)
        {
            try
            {
                await _vendedorServico.RemoverAsync(Id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (IntegridadeExcessao e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }