protected virtual async Task <IActionResult> DoUpdate(string slug, TodoItemViewModel viewModel)
        {
            var user = await this.GetLocalUser(UserService);

            var todoItem = await TodoItemService.TodoItemRepository
                           .FindOneBy(t => t.User.Id == user.Id && t.Slug == slug);

            if (todoItem == null)
            {
                return(NotFound());
            }

            await Validate(viewModel, user.Id, slug);

            if (!ModelState.IsValid)
            {
                return(ValidationProblem());
            }

            await TodoItemService.Update(todoItem, viewModel.ToDto());

            var responseBody = new
            {
                Message = StatusMessageLocalizer["TodoItemUpdated"].Value,
                Data    = todoItem.ToDto()
            };

            return(Ok(responseBody));
        }
        protected virtual async Task <IActionResult> DoCreate(TodoItemViewModel viewModel, string createdUrlPath)
        {
            var user = await this.GetLocalUser(UserService);

            await Validate(viewModel, user.Id);

            if (!ModelState.IsValid)
            {
                return(ValidationProblem());
            }

            var todoItem = await TodoItemService.Create(user, viewModel.ToDto());

            var responseBody = new
            {
                Message = StatusMessageLocalizer["TodoItemCreated"].Value,
                Data    = todoItem.ToDto()
            };

            return(Created($"{createdUrlPath}/{todoItem.Slug}", responseBody));
            //return CreatedAtAction(nameof(View), ControllerContext.ActionDescriptor.ControllerName, new { slug = todoItem.Slug }, responseBody);
        }