public async Task <Todo> CreateTodoAsync(Todo todo) { try { return(await TodoCommandRepository.CreateTodoAsync(todo)); } catch (Exception ex) { throw new FailedToCreateTodoException(ex.Message); } }
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); } }