コード例 #1
0
        public void EditToDoList(EditToDoListModel model)
        {
            User currentUser = this.GetCurrentUser();

            if (currentUser.Id != model.UserId)
            {
                throw new ArgumentException("Invalid creator id");
            }

            ToDoList selectedToDo = Task3Repo.GetToDo(model.Id);

            if (selectedToDo == null)
            {
                throw new ArgumentException("No such to-do");
            }

            selectedToDo.EditContent(model.Content);
        }
コード例 #2
0
        public IActionResult EditToDoList(EditToDoListModel inputModel)
        {
            this.task3Service.EditToDoList(inputModel);

            return(LocalRedirect("/Task3/Login"));
        }