Example #1
0
        public IDtoResult HandleUpdate(UpdateLancheCommand command)
        {
            var lanche = _repository.GetById(command.Id);

            lanche.Update(command);
            _repository.Update(lanche);

            return(lanche.ToDto());
        }
Example #2
0
 public async Task <IActionResult> Put([FromBody] UpdateLancheCommand command)
 {
     try
     {
         var Result = _handler.HandleUpdate(command);
         return(await Response(Result));
     }
     catch (Exception ex)
     {
         return(await base.Errors(ex));
     }
 }
 public void Update(UpdateLancheCommand command)
 {
     this.Nome  = command.Nome;
     this.Valor = command.Valor;
 }