Beispiel #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());
        }
Beispiel #2
0
 //Returns every single Heroe in Super Powered People list
 public IEnumerable <Person> GetSuperHeroes()
 {
     return(_dataAccess.GetDataList(_appConfig.GetSuperHeroRepo()).Select(x => new Person {
         Name = x
     }));
 }