public ApplicationService()
        {
            var eventDispatcher = new EventDispatcher();

            eventDispatcher.AutoRegisterAllEventHandler();
            var eventBus = new EventBus(eventDispatcher, new SqlEventStore(new DomainEventJsonEventSerializer(), new EventStamping(new DataMigrationUser())));

            _ioc.Register(eventBus);
            AutoRegisterQueries(Assembly.GetAssembly(typeof(IRuntimeDependency)));
        }
Beispiel #2
0
        public static IApplicationService Start(DocumentGroup documentGroup)
        {
            if (documentGroup == null)
            {
                throw new ArgumentNullException(nameof(documentGroup));
            }

            BootstrapQuery.Launch();

            var pagelocator = PageLocator.With()
                              .Element <TrainerListVm, EditableList>()
                              .Element <LocationListVm, EditableList>()
                              .Element <StudentListVm, EditableList>()
                              .Element <CompanyListVm, EditableList>()
                              .Element <CreateItemVm, CreateItem>()
                              .Element <ContactListVm, EditableList>()
                              .Element <SessionSchedulerVm, SessionScheduler>()
                              .Element <CreateSessionWindowVm, CreateSessionWindow>()
                              .Element <SeatsWindowVm, SeatsWindow>()
                              .Element <ReasonWindowVm, ReasonWindow>()
                              .Element <CreateAgreementWindowVm, CreateAgreementWindow>()
                              .Element <ManageAgreementWindowVm, ManageAgreementWindow>()
                              .Element <EventReplayerWindowVm, EventReplayerWindow>()
                              .Element <UserListVm, UserList>()
                              .Element <ChangePasswordWindowVm, ChangePasswordWindow>()
                              .Element <LoginWindowsVm, LoginWindow>()
                              .Element <ChangeRoleWindowVm, ChangeRoleWindow>()
                              .Element <TrainingFlowWindowVm, TrainingFlowWindow>()
                              .Element <HistoryWindowVm, HistoryWindow>()
                              .Element <CreateContactWindowVm, CreateContactWindow>()
                              .Element <CloseSessionWindowVm, CloseSessionWindow>()
                              .Element <TrainingListVm, EditableList>()
                              .Element <StatisticWindowVm, StatisticWindow>()
                              .Element <SeatsListerVm, ListerWindow>()
                              .Element <SessionListerVm, ListerWindow>()
                              .Element <EditStudentWindowVm, EditStudentWindow>()
                              .Build();

            var dispatcher = new EventDispatcher();

            dispatcher.AutoRegisterAllEventHandler();

            _eventStore         = new SqlEventStore(new DomainEventJsonEventSerializer(), new EventStamping(new LocalApplicationUser()));
            _applicationService = new ApplicationService(pagelocator, documentGroup, new EventBus(dispatcher, _eventStore), new Messenger());
            _applicationService.AutoRegisterSimpleDependencies(Assembly.GetAssembly(typeof(IRuntimeDependency)));

            return(_applicationService);
        }
Beispiel #3
0
        public static void Register(HttpConfiguration config)
        {
            var builder = new ContainerBuilder();

            builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
            builder.RegisterWebApiFilterProvider(config);

            var dispatcher = new EventDispatcher();

            dispatcher.AutoRegisterAllEventHandler();

            builder.Register(a => new EventBus(dispatcher, new SqlEventStore(new DomainEventJsonEventSerializer(), null))).SingleInstance();
            builder.Register(a => new TrainingSqlQueries()).As <ITrainingQueries>().SingleInstance();

            config.DependencyResolver = new AutofacWebApiDependencyResolver(builder.Build());

            config.MapHttpAttributeRoutes();
        }
Beispiel #4
0
        public void test_auto_register()
        {
            var dispatcher = new EventDispatcher();

            dispatcher.AutoRegisterAllEventHandler();
        }