Exemplo n.º 1
0
 public Phase()
 {
     FlippingContainer.Instance.ComposeParts(this);
     _phaseTeamRelationshipList = new Lazy <IList <IRelationship <ITeam, IPhase> > >(() =>
                                                                                     TeamPhaseRelationshipRepository.Find(_ => _.SecondItemInvolveId == Id)
                                                                                     .ToList());
     _gameStepList = new Lazy <IList <IGameStep> >(() =>
     {
         IList <IGameStep> result = EliminationStepRepository.Find(_ => _.PhaseId == Id)
                                    .Union <IGameStep>(QualificationStepRepository.Find(_ => _.PhaseId == Id))
                                    .ToList();
         foreach (var gameStep in result)
         {
             RegisterHandler(gameStep);
         }
         return(result);
     });
 }
Exemplo n.º 2
0
 public Team()
 {
     FlippingContainer.Instance.ComposeParts(this);
     _contest   = new ReferenceHolder <IContest, Guid>(ContestRepository);
     _matchList = new Lazy <IList <IMatch> >(() => MatchRepository.Find(_ => _.Team1Id == Id)
                                             .Union(MatchRepository.Find(_ => _.Team2Id == Id))
                                             .ToList());
     _memberList = new Lazy <IList <IRelationship <ITeam, IPerson> > >(() => TeamPersonRelationshipRepository.Find(_ => _.FirstItemInvolveId == Id).ToList());
     _gameStepTeamRelationshipList = new Lazy <IList <IRelationship <ITeam, IGameStep> > >(() => TeamGameStepRelationshipRepository.Find(_ => _.FirstItemInvolveId == Id).ToList());
     _phaseTeamRelationshipList    = new Lazy <IList <IRelationship <ITeam, IPhase> > >(() => TeamPhaseRelationshipRepository.Find(_ => _.SecondItemInvolveId == Id).ToList());
 }