Example #1
0
        List <ChampionshipCommandDTO> IFMService.FindChampionshipCommand(int NumberOfChampionshipCommands)
        {
            List <ChampionshipCommand> ChampionshipCommands = new List <ChampionshipCommand>();

            foreach (ChampionshipCommand C in _ChampionshipCommandRepository.GetListDownToTheRoot())
            {
                int NumberOfChampionshipCommandsIT = 0;
                foreach (Championship Co in C.Championships)
                {
                    foreach (Command B in C.Commands)
                    {
                        foreach (Player P in B.Players)
                        {
                            NumberOfChampionshipCommandsIT += _PlayerRepository.ListEntities().Where(obj => obj.ID == P.ID).Count();
                        }
                    }
                }
                if (NumberOfChampionshipCommandsIT == NumberOfChampionshipCommands)
                {
                    ChampionshipCommands.Add(C);
                }
            }
            return(ChampionshipCommands.Select(obj => ChampionshipCommandMapper.Map(obj)).ToList());
        }
 public void Update(ChampionshipCommandDTO model)
 {
     this.UpdateEntity(ChampionshipCommandMapper.Unmapper(model));
 }
 public void Insert(ChampionshipCommandDTO _ChampionshipCommand)
 {
     this.InsertEntity(ChampionshipCommandMapper.Unmapper(_ChampionshipCommand));
 }
 public ChampionshipCommandDTO Get(int ID)
 {
     return(ChampionshipCommandMapper.Map(this.GetEntity(ID)));
 }
 public List <ChampionshipCommandDTO> List()
 {
     return(this.ListEntities().Select(obj => ChampionshipCommandMapper.Map(obj)).ToList());
 }