public void Install(IWindsorContainer container, IConfigurationStore store) { var bus = container.Resolve<ICommandBus>(); /* container.Register(AllTypes.FromAssemblyNamed(_assemblyName) .Where(x => x.GetInterface(typeof(ICommandHandler<>).Name) != null).WithService.AllInterfaces()); var handlers = container.ResolveAll(typeof (ICommandHandler<>)); */ var userCommandHandler = new UserCommandHandler(container.Resolve<IRepository>()); var meetingCommandHandler = new MeetingCommandHandler(container.Resolve<IRepository>()); var mediaContentCommandHandler = new MediaContentCommandHandler(container.Resolve<IRepository>()); bus.RegisterCommandHandler<CreateUser>(userCommandHandler); bus.RegisterCommandHandler<UpdateUserState>(userCommandHandler); bus.RegisterCommandHandler<CreateMeeting>(meetingCommandHandler); bus.RegisterCommandHandler<AttachCameraStream>(mediaContentCommandHandler); }
public void Install(IWindsorContainer container, IConfigurationStore store) { var bus = container.Resolve <ICommandBus>(); /* * container.Register(AllTypes.FromAssemblyNamed(_assemblyName) * .Where(x => x.GetInterface(typeof(ICommandHandler<>).Name) != null).WithService.AllInterfaces()); * * * * var handlers = container.ResolveAll(typeof (ICommandHandler<>)); */ var userCommandHandler = new UserCommandHandler(container.Resolve <IRepository>()); var meetingCommandHandler = new MeetingCommandHandler(container.Resolve <IRepository>()); var mediaContentCommandHandler = new MediaContentCommandHandler(container.Resolve <IRepository>()); bus.RegisterCommandHandler <CreateUser>(userCommandHandler); bus.RegisterCommandHandler <UpdateUserState>(userCommandHandler); bus.RegisterCommandHandler <CreateMeeting>(meetingCommandHandler); bus.RegisterCommandHandler <AttachCameraStream>(mediaContentCommandHandler); }