Пример #1
0
 public IEnumerable <TechnologyStatistics> GetTechnologiesStatistics(ICollection <AggregatedCompany> res)
 {
     return(_technologiesService.GetAllTechnologies().Select(techno => new TechnologyStatistics
     {
         TechnologyName = _technologiesService.GetTechnologyName(techno),
         CompaniesWithMainTechnologies = new TechnologyStatisticsCompany
         {
             Ids = res.Where(cmp => cmp.MainTechnologies.Contains(techno)).Select(cmp => cmp.Id)
         },
         CompaniesWithSecondaryTechnologies = new TechnologyStatisticsCompany
         {
             Ids = res.Where(cmp => cmp.SecondaryTechnologies.Contains(techno)).Select(cmp => cmp.Id)
         },
         JobsWithMainTechnology = new TechnologyStatisticsJob
         {
             Ids = res.SelectMany(cmp => cmp.Jobs)
                   .Where(job => job.Value.MainTechnologies.Contains(techno))
                   .Select(job => job.Value.Id)
         },
         JobsWithSecondaryTechnology = new TechnologyStatisticsJob
         {
             Ids = res.SelectMany(cmp => cmp.Jobs)
                   .Where(job => job.Value.SecondaryTechnologies.Contains(techno))
                   .Select(job => job.Value.Id)
         }
     }));
 }
 public IEnumerable <Technologies> GetAllTechnologies()
 {
     return(_technologiesService.GetAllTechnologies());
 }