예제 #1
0
        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);
        }
예제 #2
0
        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);
        }