public static StrategyCoordinatorFactory <TIn, TOut, TContext> ResolveFactory <TIn, TOut, TContext>() where TContext : StrategyCoordinator.Core.IContext <TIn, TOut> { if (Container == null) { throw new System.InvalidOperationException("No DI container has been set. Make sure UseContainer has been called with the desired Autofac.IContainer to use for dependency resolution."); } using (var scope = Container.BeginLifetimeScope()) { StrategyCoordinator.Core.IContextFactory <TContext> contextFactory = scope.Resolve <StrategyCoordinator.Core.IContextFactory <TContext> >(); return(new StrategyCoordinatorFactory <TIn, TOut, TContext>(contextFactory, Container)); } }
public StrategyCoordinatorFactory(StrategyCoordinator.Core.IContextFactory <TContext> contextFactory, System.IServiceProvider serviceProvider) : base(contextFactory) { this._serviceProvider = serviceProvider; }
public StrategyCoordinatorFactory(StrategyCoordinator.Core.IContextFactory <TContext> contextFactory, IContainer container) : base(contextFactory) { this._container = container; }