public async Task <IEnumerable <Project> > GetAllProjectsWithWorkingHoursAsync()
        {
            var projectsWithWorkingHours = await _reportFacade.GetTotalWorkingHoursByProjectAsync();

            List <Project> modelList = new List <Project>();

            for (int i = 0; i < projectsWithWorkingHours.Count(); i++)
            {
                Project model = new Project()
                {
                    ProjectId = projectsWithWorkingHours.ElementAt(i).ProjectId,
                    Name      = projectsWithWorkingHours.ElementAt(i).ProjectName
                };
                modelList.Add(model);
            }
            return(modelList);
        }
コード例 #2
0
 public async Task <IActionResult> GetWorkingHoursByProjects()
 {
     return(Ok(await _reportFacade.GetTotalWorkingHoursByProjectAsync()));
 }