Esempio n. 1
0
        public object Handler(ToggleTaskCommand command)
        {
            var task = _repository.Get(command.Id);

            task.ToggleCompleted();

            _repository.Update(task);
            _uow.Commit();

            return(new { task.Id, task.Completed });
        }
Esempio n. 2
0
 public IActionResult Completed(ToggleTaskCommand command)
 {
     try
     {
         var result = _hander.Handler(command);
         return(Ok(result));
     }
     catch (Exception)
     {
         // tratamento de erros, logs etc...
         throw;
     }
 }