Пример #1
0
 protected GameStep()
 {
     FlippingContainer.Instance.ComposeParts(this);
     _phase = new ReferenceHolder <IPhase, Guid>(PhaseRepository);
     _currentMatchSetting          = new ReferenceHolder <IMatchSetting, Guid>(MatchSettingRepository);
     _gameStepTeamRelationshipList = new Lazy <IList <IRelationship <ITeam, IGameStep> > >(() =>
                                                                                           TeamGameStepRelationshipRepository
                                                                                           .Find(_ => _.SecondItemInvolveId == Id).ToList());
     _matchList = new Lazy <IList <IMatch> >(() =>
     {
         IList <IMatch> result = MatchRepository.Find(_ => _.GameStepId == Id).ToList();
         foreach (var match in result)
         {
             RegisterHandler(match);
         }
         return(result);
     });
 }
Пример #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());
 }