membus

multiple types for SetHandlerInterface() with membus and ioc container

我的梦境 提交于 2019-12-22 05:38:28
问题 Going over demo CQRS code here the command and event handlers are wired up separately as below: public interface CommandHandler<in T> { void Handle(T command); } public interface EventHandler<in T> { void Handle(T @event); } bus = BusSetup.StartWith<Conservative>() .Apply<FlexibleSubscribeAdapter>(a => { a.ByInterface(typeof(IHandleEvent<>)); a.ByInterface(typeof(IHandleCommand<>)); }) .Construct(); I am using an IoC container hooked in with membus and it works a dream by implementing the

multiple types for SetHandlerInterface() with membus and ioc container

风流意气都作罢 提交于 2019-12-05 06:27:07
Going over demo CQRS code here the command and event handlers are wired up separately as below: public interface CommandHandler<in T> { void Handle(T command); } public interface EventHandler<in T> { void Handle(T @event); } bus = BusSetup.StartWith<Conservative>() .Apply<FlexibleSubscribeAdapter>(a => { a.ByInterface(typeof(IHandleEvent<>)); a.ByInterface(typeof(IHandleCommand<>)); }) .Construct(); I am using an IoC container hooked in with membus and it works a dream by implementing the IEnumerable<object> GetAllInstances(Type desiredType) interface with my container, however unlike the demo