public static List <Type> ThatApplyTo(this PluginDefinitions <IBehavior, BehaviorContext> behaviors, ActionSourceContext context, ActionMethod actionMethod, RouteDescriptor routeDescriptor) { return(behaviors.ThatApplyTo(new BehaviorContext(context.Configuration, context .HttpConfiguration, actionMethod, routeDescriptor)) .Select(x => x.Type).ToList()); }
public static void Append <TPlugin, TContext>(this PluginDefinitions <TPlugin, TContext> definitions, Type type, Func <TContext, bool> predicate = null, bool singleton = false) { typeof(PluginDefinitions <TPlugin, TContext>) .GetMethods().FirstOrDefault(x => x.Name == "Append") .MakeGenericMethod(type) .Invoke(definitions, new object[] { predicate, singleton }); }
public void Setup() { _definitions = new PluginDefinitions <ISomePlugin, SomePluginContext>(); }