public async Task <ToDoListViewModel> Handle(CreateToDoListCommand request, CancellationToken cancellationToken) { Logger.LogInformation($"Received request to create To Do List {request.Name}"); ToDoList newToDoList = (ToDoList)request; var response = await ToDoListRepository.Insert(newToDoList); return(new ToDoListViewModel(response)); }
public void Save(ToDoListEntity toDoListEntity) { if (toDoListEntity.Id == 0) { _toDoListRepository.Insert(toDoListEntity); } else { _toDoListRepository.Update(toDoListEntity); } }
public void CreateToDoList(string listName) { ToDoListRepository toDoListRepository = new ToDoListRepository(); ToDoList newList = new ToDoList(); newList.listName = listName; newList.userId = currentUser.userId; toDoListRepository.Insert(newList); }
private void listConfirm_Click(object sender, RoutedEventArgs e) { ToDoList _newList = new ToDoList(); _newList.created_at = DateTime.Now; _newList.ToDoListUserId = _user.UserId; _newList.name = listName.Text; _toDoListRepository.Insert(_newList); _toDoListRepository.Save(); _main.Populate(); _main.RefreshList(); this.Close(); }