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));
        }
Exemplo n.º 2
0
 public void Save(ToDoListEntity toDoListEntity)
 {
     if (toDoListEntity.Id == 0)
     {
         _toDoListRepository.Insert(toDoListEntity);
     }
     else
     {
         _toDoListRepository.Update(toDoListEntity);
     }
 }
Exemplo n.º 3
0
        public void CreateToDoList(string listName)
        {
            ToDoListRepository toDoListRepository = new ToDoListRepository();

            ToDoList newList = new ToDoList();

            newList.listName = listName;
            newList.userId   = currentUser.userId;

            toDoListRepository.Insert(newList);
        }
Exemplo n.º 4
0
        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();
        }