public static void Test() { IBehaviorProvider behaviorProvider = new AttributeBehaviorCollection() .Add(typeof(LogAttribute), typeof(LogBehavior)); ReflectionPipeline <ProductQueryHandler> pipeline = new ReflectionPipeline <ProductQueryHandler>(behaviorProvider, new DefaultReflectionBehaviorFactory()); IQueryHandler <ProductQuery, Product> queryHandler = new BehaviorQueryHandler <ProductQueryHandler, ProductQuery, Product>(pipeline, new DefaultFactory <ProductQueryHandler>()); Task <Product> task = queryHandler.HandleAsync(new ProductQuery() { Name = "Test" }); if (!task.IsCompleted) { task.RunSynchronously(); } Console.WriteLine(task.Result.Price); }
public void Setup() { BaseSetup(); pipeline = new ReflectionPipeline(middlewareTypes, typeof(Message)); }