public static void Intercept <TInterceptor>(this IRegistrator registrator, Func <Type, bool> predicate) where TInterceptor : class, IInterceptor { foreach (var registration in registrator.GetServiceRegistrations().Where(r => predicate(r.ServiceType))) { registrator.Intercept <TInterceptor>(registration.ServiceType); } }
public static void InterceptAsync <TService, TInterceptor>(this IRegistrator registrator, object serviceKey = null) where TInterceptor : class, IAsyncInterceptor { registrator.Register <AsyncInterceptor <TInterceptor> >(); registrator.Intercept <TService, AsyncInterceptor <TInterceptor> >(serviceKey); }
public static void Intercept <TInterceptor>(this IRegistrator registrator, Type serviceType, object serviceKey = null) where TInterceptor : class, IInterceptor { registrator.Intercept <TInterceptor>(serviceType, serviceType, serviceKey); }
public static void Intercept <TService, TInterceptor>(this IRegistrator registrator, object serviceKey = null) where TInterceptor : class, IInterceptor => registrator.Intercept <TInterceptor>(typeof(TService), serviceKey);
public static void Intercept <TInterceptor>(this IRegistrator registrator, Type serviceType, object serviceKey = null) where TInterceptor : class, IInterceptor => registrator.Intercept(serviceType, Parameters.Of.Type(typeof(IInterceptor[]), typeof(TInterceptor[])), serviceKey);