public void Execute(object parameter) { TaskListViewModel vm = parameter as TaskListViewModel; var command = new TaskCreateCommand(vm.InputTaskName, vm.InputCategory); var service = new TaskApplicationService(taskFactory, taskRepository); var taskRslt = service.Create(command); var taskData = DomainVMConverter.ConvTaskDomainToVM(taskRslt.Task); vm.TaskDataList.Add(taskData); }
public IActionResult Post(int userid, string title, string content, DateTime dueDate) { var service = new TaskApplicationService(_taskRepository); var result = service.Create(userid, title, content, dueDate); if (result) { return(Ok()); } else { return(BadRequest()); } }