public virtual void UseAsync <TStrategy>() where TStrategy : IAsyncProcessStrategy <TContext> { var strategyType = typeof(TStrategy); IAsyncProcessStrategy <TContext> strategy = (TStrategy)System.Activator.CreateInstance(strategyType); this.UseAsync(strategy); }
public virtual void UseAsync(IAsyncProcessStrategy <TContext> strategy) { if (strategy == null) { throw new System.ArgumentNullException("Tried to queue a null value for strategy."); } this.UseAsync(strategy.ProcessAsync); }