开发者

nservicebus subscriber implementation

开发者 https://www.devze.com 2023-01-11 23:02 出处:网络
Is having the event handler in the subscriber required? For example: Projec开发者_StackOverflowts: Crm.Events:

Is having the event handler in the subscriber required? For example:

Projec开发者_StackOverflowts:

Crm.Events: NewUserCreated : IMessage {}

Crm.Publisher: console app publishes as Bus.Publish(new NewUserCreated());

Crm.Subscriber: console app subscribing to the NewUserCreated event.

Crm.EventHandlers NewUserCreatedHandler : IHandleMessages { ... }

Do I need the NewUserCreatedHandler in Crm.Subscriber or can I just reference the Crm.EventHandlers assembly in Crm.Subscriber so NSB can invoke the handler?

Thanks


You can just reference the eventhandler assembly. This is because NSB scan all assemblies in your bin directory for classed that implements IHandleMessages.

That said, can you explain why would you want to separate the messagehandlers from your "Crm.Subscriber" project?

0

精彩评论

暂无评论...
验证码 换一张
取 消