public ICommandResult Execute(DeleteFabricanteCommand command)
        {
            var Fabricante = FabricanteRepository.GetById(command.Id);

            FabricanteRepository.Delete(Fabricante);
            unitOfWork.Commit();
            return(new CommandResult(true));
        }
Exemple #2
0
 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));
     }
 }
Exemple #3
0
 public async Task Delete(long id)
 {
     await _repository.Delete(id);
 }