Пример #1
0
        public static void Setup()
        {
            Dispatcher = new MessageDispatcher(new SqlEventStore(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString));

            CommandQueries = ReadModelFactory <CommandQueries>();

            Dispatcher.ScanInstance(new ParticipantCommandHandlers(CommandQueries));
            Dispatcher.ScanInstance(new ContingentCommandHandlers(CommandQueries));
            Dispatcher.ScanInstance(new ScoresCommandHandlers(CommandQueries, Dispatcher)); //TODO: Refactor Dispatcher out of Handler
            Dispatcher.ScanInstance(new TournamentCommandHandlers(CommandQueries));

            StatisticsQueries             = ReadModelFactory <StatisticsQueries>();
            ParticipantQueries            = ReadModelFactory <ParticipantQueries>();
            ParticipantProfileQueries     = ReadModelFactory <ParticipantProfileQueries>();
            ContingentViewQueries         = ReadModelFactory <ContingentViewQueries>();
            ContingentTravelPlanQueries   = ReadModelFactory <ContingentTravelPlanQueries>();
            ContingentPracticePlanQueries = ReadModelFactory <ContingentPracticePlanQueries>();
            ReservationQueries            = ReadModelFactory <ReservationQueries>();
            ScheduleQueries         = ReadModelFactory <ScheduleQueries>();
            MatchQueries            = ReadModelFactory <MatchQueries>();
            StandingQueries         = ReadModelFactory <StandingQueries>();
            HighScoreQueries        = ReadModelFactory <HighScoreQueries>();
            ParticipantScoreQueries = ReadModelFactory <ParticipantScoreQueries>();
            TeamScoreQueries        = ReadModelFactory <TeamScoreQueries>();
            TournamentQueries       = ReadModelFactory <TournamentQueries>();
            StepladderQueries       = ReadModelFactory <StepladderQueries>();
        }
Пример #2
0
 public ScheduleController(IScheduleService scheduleService,
                           IUCenterService uCenterService,
                           IMediator mediator,
                           IScheduleQueries queries,
                           IBlogApiService blogApiSvc)
 {
     _scheduleService = scheduleService;
     _uCenterService  = uCenterService;
     _mediator        = mediator;
     _queries         = queries;
     _blogApiSvc      = blogApiSvc;
 }
Пример #3
0
        public static void Setup()
        {
            ReadModelFolder = HttpContext.Current.Server.MapPath("~/App_Data/ReadModels/");

            Dispatcher = new MessageDispatcher(new SqlEventStore(Properties.Settings.Default.DefaultConnection));

            Dispatcher.ScanInstance(new ParticipantCommandHandlers(Dispatcher));
            Dispatcher.ScanInstance(new ContingentCommandHandlers());
            Dispatcher.ScanInstance(new ScoresCommandHandlers(Dispatcher));

            ParticipantQueries = new ParticipantQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ParticipantQueries);

            ParticipantProfileQueries = new ParticipantProfileQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ParticipantProfileQueries);

            ContingentQueries = new ContingentQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ContingentQueries);

            ContingentViewQueries = new ContingentViewQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ContingentViewQueries);

            ContingentTravelPlanQueries = new ContingentTravelPlanQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ContingentTravelPlanQueries);

            ContingentPracticePlanQueries = new ContingentPracticePlanQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ContingentPracticePlanQueries);

            ContingentEventHistoryQueries = new ContingentEventHistoryQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ContingentEventHistoryQueries);

            ReservationQueries = new ReservationQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ReservationQueries);

            ScheduleQueries = new ScheduleQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ScheduleQueries);

            MatchQueries = new MatchQueries(ReadModelFolder);
            Dispatcher.ScanInstance(MatchQueries);

            StandingQueries = new StandingQueries(ReadModelFolder);
            Dispatcher.ScanInstance(StandingQueries);

            HighScoreQueries = new HighScoreQueries(ReadModelFolder);
            Dispatcher.ScanInstance(HighScoreQueries);

            ParticipantScoreQueries = new ParticipantScoreQueries(ReadModelFolder);
            Dispatcher.ScanInstance(ParticipantScoreQueries);

            TeamScoreQueries = new TeamScoreQueries(ReadModelFolder);
            Dispatcher.ScanInstance(TeamScoreQueries);

            if (!Directory.Exists(ReadModelFolder))
            {
                RebuildReadModels();
            }
        }
Пример #4
0
 public TrailerController(IMessageDispatcher dispatcher, IScheduleQueries scheduleQueries)
 {
     _dispatcher      = dispatcher;
     _scheduleQueries = scheduleQueries;
     _trailerId       = Constants.TrailerId;
 }