public async Task <ActionResult <TodoReadDTO> > CreateTodo([FromBody] TodoCreateDTO todoCreateDto) { var request = new CreateTodoCommand(User.Identity?.Name, todoCreateDto); var createdTodo = await _mediator.Send(request); return(CreatedAtRoute(nameof(GetTodoById), new { Id = createdTodo.Id }, createdTodo)); }
public async Task <bool> CreateTodo(TodoCreateDTO dto) { var rao = _mapper.Map <TodoCreateRAO>(dto); if (await _repository.CreateTodo(rao)) { return(true); } throw new NotImplementedException(); }
public CreateTodoCommand(string?userLogin, TodoCreateDTO createDTO) : base(userLogin) { CreateDTO = createDTO; }