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); }
public async Task <IActionResult> GetWorkingHoursByProjects() { return(Ok(await _reportFacade.GetTotalWorkingHoursByProjectAsync())); }