public ICommandResult Execute(DeleteFabricanteCommand command) { var Fabricante = FabricanteRepository.GetById(command.Id); FabricanteRepository.Delete(Fabricante); unitOfWork.Commit(); return(new CommandResult(true)); }
public ActionResult <Fornecedor> Excluir([FromHeader] string ibge, [FromRoute] int id) { try { ibge = _config.GetConnectionString(Connection.GetConnection(ibge)); _fabricanteRepository.Delete(ibge, id); return(Ok()); } catch (Exception ex) { var response = TrataErro.GetResponse(ex.Message, true); return(StatusCode((int)HttpStatusCode.InternalServerError, response)); } }
public async Task Delete(long id) { await _repository.Delete(id); }