예제 #1
0
 public CqsModule()
 {
     CommandBus      = new SimpleCommandBus();
     QueryBus        = new SimpleQueryBus();
     EventBus        = new SimpleEventBus();
     RequestReplyBus = new SimpleRequestReplyBus();
     _requestMethod  = GetType().GetMethod("ExecuteRequest", BindingFlags.NonPublic | BindingFlags.Instance);
     _commandMethod  = GetType().GetMethod("ExecuteCommand", BindingFlags.NonPublic | BindingFlags.Instance);
     _queryMethod    = GetType().GetMethod("ExecuteQuery", BindingFlags.NonPublic | BindingFlags.Instance);
 }
예제 #2
0
        private static CqsServer CreateServer()
        {
            var cmdBus = new SimpleCommandBus();
            cmdBus.Register(typeof (Program).Assembly);

            var queryBus = new SimpleQueryBus();
            queryBus.Register(typeof (Program).Assembly);

            var requestReplyBus = new SimpleRequestReplyBus();
            requestReplyBus.Register(typeof (Program).Assembly);

            var eventBus = new SimpleEventBus();
            eventBus.Register(typeof (Program).Assembly);

            var server = new CqsServer(cmdBus, queryBus, eventBus, requestReplyBus);
            server.SerializerFactory = () => new JsonMessageSerializer();
            
            return server;
        }
예제 #3
0
        private static CqsServer CreateServer()
        {
            var cmdBus = new SimpleCommandBus();

            cmdBus.Register(typeof(Program).Assembly);

            var queryBus = new SimpleQueryBus();

            queryBus.Register(typeof(Program).Assembly);

            var requestReplyBus = new SimpleRequestReplyBus();

            requestReplyBus.Register(typeof(Program).Assembly);

            var eventBus = new SimpleEventBus();

            eventBus.Register(typeof(Program).Assembly);

            var server = new CqsServer(cmdBus, queryBus, eventBus, requestReplyBus);

            server.SerializerFactory = () => new JsonMessageSerializer();

            return(server);
        }