示例#1
0
        //Splits all super powered people ito groups
        public void SplitSuperPoweredIntoGroups()
        {
            string rule       = _appConfig.GetRuleForVillains();
            var    listPeople = _readService.GetAllSuperPoweredEntities().ToList();

            var listVillans = listPeople.Where(x => x.Name.Contains(rule)).Select(x => x.Name);

            _dataAccess.SaveDataList(listVillans.ToList(), _appConfig.GetVillansrepo());

            var listSuperHeroes = listPeople.Where(x => !x.Name.Contains(rule)).Select(x => x.Name);

            _dataAccess.SaveDataList(listSuperHeroes.ToList(), _appConfig.GetSuperHeroRepo());
        }
 public IEnumerable <PersonType> GetAllSuperPoweredEntities()
 {
     return(_dataServiceRead.GetAllSuperPoweredEntities().Select(x => new PersonType {
         Name = x.Name
     }));
 }