コード例 #1
0
        /// <summary>
        /// Updates the existing todo-item.
        /// </summary>
        /// <param name="todo">The todo-item to update.</param>
        public void Put(TaskViewModel todo)
        {
            if (todo == null)
            {
                return;
            }

            todo.UserId = userService.GetOrCreateUser();
            todoService.Update(todo.GetBllEntity());
        }
コード例 #2
0
 /// <summary>
 /// Creates a new todo-item.
 /// </summary>
 /// <param name="todo">The todo-item to create.</param>
 public TaskViewModel Post(TaskViewModel todo)
 {
     todo.UserId = userService.GetOrCreateUser();
     return(todoService.Add(todo.GetBllEntity()).GetTaskViewEntity());
 }