本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: AttachMessageHandlersToBus
public void AttachMessageHandlersToBus(IBus bus, string endpointName)
{
var handlers = BuildAll(typeof (IHandleMessage<>));
foreach (var handler in handlers)
{
bus.RegisterHandler(handler, endpointName);
}
}
示例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>();
}
示例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);
}
示例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>();
}
示例8: SetupDomainEventHandlers
private static void SetupDomainEventHandlers(IBus bus)
{
//TODO: Resolve through IoC
var view = new DinnerListView();
bus.RegisterHandler<DinnerCreated>(view.Handle);
}