Пример #1
0
        public async Task <IActionResult> Edit(TodoItemEditModel model)
        {
            var todoItem = await _services.GetByIdAsync(model.Id);

            todoItem.Title       = model.Title;
            todoItem.IsCompleted = model.IsCompleted;

            _services.EditAsync(todoItem).Wait();

            return(RedirectToAction("Index"));
        }
Пример #2
0
        private TodoItemEditModel ToEditModel(TodoItem item)
        {
            var model = new TodoItemEditModel
            {
                Id          = item.Id,
                Title       = item.Title,
                IsCompleted = item.IsCompleted
            };

            return(model);
        }