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));
        }
Exemple #2
0
        public async Task <bool> CreateTodo(TodoCreateDTO dto)
        {
            var rao = _mapper.Map <TodoCreateRAO>(dto);

            if (await _repository.CreateTodo(rao))
            {
                return(true);
            }

            throw new NotImplementedException();
        }
Exemple #3
0
 public CreateTodoCommand(string?userLogin, TodoCreateDTO createDTO) : base(userLogin)
 {
     CreateDTO = createDTO;
 }