public IDtoResult HandleUpdate(UpdateIngredienteCommand command)
        {
            var ingrediente = _repository.GetById(command.Id);

            ingrediente.Update(command);
            _repository.Update(ingrediente);

            return(ingrediente.ToDto());
        }
 public async Task <IActionResult> Put([FromBody] UpdateIngredienteCommand command)
 {
     try
     {
         var Result = _handler.HandleUpdate(command);
         return(await Response(Result));
     }
     catch (Exception ex)
     {
         return(await base.Errors(ex));
     }
 }
Пример #3
0
 public void Update(UpdateIngredienteCommand command)
 {
     this.Nome  = command.Nome;
     this.Valor = command.Valor;
 }