Ejemplo n.º 1
0
        private static void SampleQueryHandler()
        {
            var injector = new SimpleInjector();

            injector.Register <IQueryHandler <TestQuery, TestResponse> >(() => new TestQueryHandler());

            var queryBus = new QueryBus(injector);

            queryBus.Register <TestQuery, IQueryHandler <TestQuery, TestResponse> >();

            var query    = new TestQuery("srn");
            var response = queryBus.Handle(query);

            Console.WriteLine(response.Message);
        }