Esempio n. 1
0
        public IDtoResult HandleAdd(AddLancheCommand command)
        {
            var lanche = new LancheEntity(command.Nome, command.Valor);

            _repository.Add(lanche);

            return(lanche.ToDto());
        }
Esempio n. 2
0
 public async Task <IActionResult> Post([FromBody] AddLancheCommand command)
 {
     try
     {
         var Result = _handler.HandleAdd(command);
         return(await Response(Result));
     }
     catch (Exception ex)
     {
         return(await base.Errors(ex));
     }
 }