private void InitGroupsResults(IEnumerable <ResultEntity> allResultEntities)
        {
            var programmerGroupResults    = new GroupResults(Constants.ProgrammersGroupNameString);
            var nonProgrammerGroupResults = new GroupResults(Constants.NonProgrammersGroupNameString);
            var groupedResultEntities     = allResultEntities.GroupBy(IsProgrammer);

            foreach (var group in groupedResultEntities)
            {
                if (group.Key)  // Программист
                {
                    programmerGroupResults.Results = GroupResults.MakeResults(group);
                }
                else            // Не программист
                {
                    nonProgrammerGroupResults.Results = GroupResults.MakeResults(group);
                }
            }

            GroupsResults = new List <GroupResults>();
            GroupsResults.Add(new GroupResults(Constants.EveryoneGroupNameString, allResultEntities));
            GroupsResults.Add(programmerGroupResults);
            GroupsResults.Add(nonProgrammerGroupResults);
        }
 private static IEnumerable <Result> MakeResultsForScale(IEnumerable <ResultEntity> resultEntities, int scaleId)
 {
     return(GroupResults.MakeResults(resultEntities.Where(re => re.ScaleId == scaleId)));
 }