Exemplo n.º 1
0
 public async Task <Todo> CreateTodoAsync(Todo todo)
 {
     try
     {
         return(await TodoCommandRepository.CreateTodoAsync(todo));
     }
     catch (Exception ex)
     {
         throw new FailedToCreateTodoException(ex.Message);
     }
 }
Exemplo n.º 2
0
 public async Task <Todo> DeleteTodoAsync(Todo todo)
 {
     try
     {
         return(await TodoCommandRepository.DeleteTodoAsync(todo));
     }
     catch (TodoNotFoundException ex)
     {
         throw new TodoNotFoundException(ex.Message);
     }
     catch (Exception ex)
     {
         throw new FailedToDeleteTodoException(ex.Message);
     }
 }