当前位置: 首页>>代码示例>>C#>>正文


C# IBus.RegisterHandler方法代码示例

本文整理汇总了C#中IBus.RegisterHandler方法的典型用法代码示例。如果您正苦于以下问题:C# IBus.RegisterHandler方法的具体用法?C# IBus.RegisterHandler怎么用?C# IBus.RegisterHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IBus的用法示例。


在下文中一共展示了IBus.RegisterHandler方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetupDomainEventHandlers

        private static void SetupDomainEventHandlers(IBus bus)
        {
            //TODO: Resolve through IoC
            var sqlView = new SqlDinnerListView();
            bus.RegisterHandler<DinnerCreated>(sqlView.Handle);

            var ravenView = new RavenDinnerListView();
            bus.RegisterHandler<DinnerCreated>(ravenView.Handle);
        }
开发者ID:joobn72,项目名称:CQRSWorkshop,代码行数:9,代码来源:EventStoreConfig.cs

示例2: SetupEventHandlers

        private static void SetupEventHandlers(IBus bus, IReportingRepository<PatientDto> reportingRepository)
        {
            var patientEventHandler = new PatientView(reportingRepository);
            bus.RegisterHandler<PatientCreatedEvent>(patientEventHandler.Handle);
            bus.RegisterHandler<PatientNameChangedEvent>(patientEventHandler.Handle);
            bus.RegisterHandler<PatientRelocatedEvent>(patientEventHandler.Handle);

            //var patientEventPublisher = new PatientEventPublisher();
            //bus.RegisterHandler<PatientCreatedEvent>(patientEventPublisher.Handle);
        }
开发者ID:jcarley,项目名称:PatientRecords,代码行数:10,代码来源:BootStrapper.cs

示例3: SetupDomainEventHandlers

        private static void SetupDomainEventHandlers(IBus bus, IDocumentStore documentStore)
        {
            //TODO: Resolve through IoC

            var view = new CustomerListView(documentStore);
            bus.RegisterHandler<CustomerCreatedEvent>(view.Handle);
            bus.RegisterHandler<CustomerRelocatedEvent>(view.Handle);

            var addressView = new CustomerAddressView(documentStore);
            bus.RegisterHandler<CustomerCreatedEvent>(addressView.Handle);
            bus.RegisterHandler<CustomerRelocatedEvent>(addressView.Handle);
        }
开发者ID:phatboyg,项目名称:CQRS-Sample,代码行数:12,代码来源:BootStrapper.cs

示例4: AttachMessageHandlersToBus

        public void AttachMessageHandlersToBus(IBus bus, string endpointName)
        {
            var handlers = BuildAll(typeof (IHandleMessage<>));

            foreach (var handler in handlers)
            {
                bus.RegisterHandler(handler, endpointName);
            }
        }
开发者ID:sebfia,项目名称:EasyNetQ,代码行数:9,代码来源:StandardContainer.cs

示例5: ConfigureRegistryBoundedContext

        private static void ConfigureRegistryBoundedContext(IUnityContainer container, IBus bus)
        {
            //Denormalizers
            bus.RegisterHandler<PersonDenormalizer>();
            bus.RegisterHandler<CompanyDenormalizer>();

            //Handlers

            //Sagas
            bus.RegisterSaga<CompanySaga>();
            bus.RegisterSaga<PersonSaga>();

            //Types
            container.RegisterType<Merp.Registry.QueryStack.IDatabase, Merp.Registry.QueryStack.Database>();

            //Worker Services
            container.RegisterType<PersonControllerWorkerServices, PersonControllerWorkerServices>();
        }
开发者ID:pachinko,项目名称:naa4e,代码行数:18,代码来源:Bootstrapper.cs

示例6: Setup

 public void Setup()
 {
     var scoreCalculator = new SimpleScoreCalculator();
     _scoreQuery = new ScoreQuery(new Mock<ISignaler>().Object, scoreCalculator);
     var eventBus = new DomainBus();
     eventBus.RegisterHandler(() => new GameHandler(_scoreQuery));
     var eventStorage = new InMemoryEventStorage();
     var sessionFactory = new SessionFactory(eventStorage);
     var gameService = new GameService(sessionFactory, eventBus);
     _commandbus = new DomainBus();
     _commandbus.RegisterHandler(() => gameService);
 }
开发者ID:ankfunstuff,项目名称:FoosballWeb,代码行数:12,代码来源:CompetitionIT.cs

示例7: ConfigureAccountancyBoundedContext

        private static void ConfigureAccountancyBoundedContext(IUnityContainer container, IBus bus)
        {
            //Denormalizers
            bus.RegisterHandler<FixedPriceJobOrderDenormalizer>();
            bus.RegisterHandler<IncomingInvoiceDenormalizer>();
            bus.RegisterHandler<InvoiceDenormalizer>();
            bus.RegisterHandler<OutgoingInvoiceDenormalizer>();
            bus.RegisterHandler<TimeAndMaterialJobOrderDenormalizer>();

            //Handlers
            bus.RegisterHandler<JobOrderHandler>();

            //Sagas
            bus.RegisterSaga<FixedPriceJobOrderSaga>();
            bus.RegisterSaga<IncomingInvoiceSaga>();
            bus.RegisterSaga<OutgoingInvoiceSaga>();
            bus.RegisterSaga<TimeAndMaterialJobOrderSaga>();  

            //Services
            container.RegisterType<IJobOrderNumberGenerator, JobOrderNumberGenerator>();
            container.RegisterType<IOutgoingInvoiceNumberGenerator, OutgoingInvoiceNumberGenerator>();

            //Types
            container.RegisterType<Merp.Accountancy.QueryStack.IDatabase, Merp.Accountancy.QueryStack.Database>();

            //Worker Services
            container.RegisterType<InvoiceControllerWorkerServices, InvoiceControllerWorkerServices>();
            container.RegisterType<JobOrderControllerWorkerServices, JobOrderControllerWorkerServices>();
        }
开发者ID:pachinko,项目名称:naa4e,代码行数:29,代码来源:Bootstrapper.cs

示例8: SetupDomainEventHandlers

 private static void SetupDomainEventHandlers(IBus bus)
 {
     //TODO: Resolve through IoC
     var view = new DinnerListView();
     bus.RegisterHandler<DinnerCreated>(view.Handle);
 }
开发者ID:joobn72,项目名称:CQRSWorkshop,代码行数:6,代码来源:EventStoreConfig.cs


注:本文中的IBus.RegisterHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。