/// <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()); }
/// <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()); }