public IDtoResult HandleAdd(AddIngredienteCommand command) { var ingrediente = new IngredienteEntity(command.Nome, command.Valor); _repository.Add(ingrediente); return(ingrediente.ToDto()); }
public async Task <IActionResult> Post([FromBody] AddIngredienteCommand command) { try { var Result = _handler.HandleAdd(command); return(await Response(Result)); } catch (Exception ex) { return(await base.Errors(ex)); } }