/// <summary> /// Updates a todo. /// </summary> /// <param name="item">The todo to update.</param> public void UpdateItem(ToDoItemViewModel item) { repository.Update(item.ToToDoDal()); listOfChanges.RemoveAll(i => i.ToDo.ToDoId == item.ToDoId && i.Operation != Operation.Create); listOfChanges.Add(new Message(item, Operation.Update)); }
/// <summary> /// Creates a todo. UserId is taken from the model. /// </summary> /// <param name="item">The todo to create.</param> public void CreateItem(ToDoItemViewModel item) { var toDo = repository.Create(item.ToToDoDal()); idPull.Add(new IdInfo { DbId = toDo.Id }); listOfChanges.Add(new Message(toDo.ToToDoViewModel(), Operation.Create)); }
/// <summary> /// Creates a todo. UserId is taken from the model. /// </summary> /// <param name="item">The todo to create.</param> public void CreateItem(ToDoItemViewModel item) { repository.Create(item.ToToDoDal()); listOfChanges.Add(new Message(item, Operation.Create)); }