Ejemplo n.º 1
0
        public async Task <CreateActivityListResponse> Handle(CreateActivityListCommand request,
                                                              CancellationToken cancellationToken)
        {
            var activity = ActivityListAggregateRoot.Create();

            await this.AggregateRepository.SaveAsync(activity);

            return(new CreateActivityListResponse());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create(CreateActivityListCommand command)
        {
            if (await Mediator.Send(command) == null)
            {
                return(BadRequest());
            }

            var activityList = await Mediator.Send(new GetActivityListDetailQuery { Id = command.Id });

            if (command.File != null)
            {
                await UploadFile(command.ProjectNumber, activityList.Number, command.File);
            }

            return(PartialView("_ActivityList", new ActivityListViewModel
            {
                Id = command.Id,
                Name = command.Name,
                ProjectId = command.ProjectId
            }));
        }