Esempio n. 1
0
        public async Task <IActionResult> Detail(int id)
        {
            // Summary
            //
            // Returns Project overview including list of Bugs, consumes internal API

            var vm = await _projectsApi.GetProjectAsync(id);

            return(View(vm));
        }
Esempio n. 2
0
        public async Task <IActionResult> Detail(int projectId, int id)
        {
            // Summary
            //
            // Fetch bug, and project details from Endpoints and render associated view

            var vm = new BugDetailVm
            {
                Bug       = await _bugsApi.GetBugAsync(id).ConfigureAwait(false),
                ProjectId = projectId,
                UserName  = User.FindFirst(ClaimTypes.Name).Value.Split("@")?[0] ?? "guest"
            };

            var project = await _projectsApi.GetProjectAsync(projectId).ConfigureAwait(false);

            vm.ProjectName = project.Title;

            return(View(vm));
        }