public async Task <IActionResult> AddProjectBug([BindRequired] long?projectId)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction(nameof(Details), new { projectId = projectId.Value }));
            }

            var readProjectRequest = new ReadProjectRequest
            {
                ProjectId = projectId.Value
            };
            var foundProject = await _projectApplicationService.Handle(readProjectRequest);

            var readAvailableTagsRequest = new ReadTagsRequest();
            var availableTags            = await _tagApplicationService.Handle(readAvailableTagsRequest);

            var viewModel = new AddProjectBugViewModel
            {
                ProjectId   = projectId,
                TeamMembers = foundProject.TeamMembers
                              .Select(user => new SelectListItem {
                    Value = user.Id.ToString(), Text = user.FullName
                })
                              .ToList(),
                AvailableTags = availableTags
                                .Select(tag => new SelectListItem {
                    Value = tag.Id.ToString(), Text = tag.Name,
                })
                                .ToList()
            };

            return(View(viewModel));
        }
Beispiel #2
0
        public async Task <IActionResult> Index()
        {
            var readTagsRequest = new ReadTagsRequest();
            var response        = await _tagApplicationService.Handle(readTagsRequest);

            return(View(response));
        }