public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (UnitOfWorkHelper.IsUnitOfWorkType(context.ImplementationType.GetTypeInfo())) { context.Interceptors.TryAdd <UnitOfWorkInterceptor>(); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <FeaturesValidationInterceptor>(); } }
public static void Register(IOnServiceRegistredContext registrationContext) { if (registrationContext.ImplementationType == typeof(AlohaService)) { registrationContext.Interceptors.TryAdd <AlohaInterceptor>(); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (typeof(IValidationEnabled).IsAssignableFrom(context.ImplementationType)) { context.Interceptors.TryAdd <ValidationInterceptor>(); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <EntityChangedRulesInterceptor>(); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <DistributedCacheInterceptor> (); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { if (typeof(IApplicationService).IsAssignableFrom(context.ImplementationType)) { context.Interceptors.TryAdd <AuthorizationInterceptor>(); } }
/// <summary> /// Registers if needed. /// </summary> /// <param name="context">The context.</param> public static void RegisterIfNeeded(IOnServiceRegistredContext context) { // 根据回调传入的context 绑定的实现类型,判断是否应该为该类型注册 UnitOfWorkInterceptor 拦截器。 if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <UnitOfWorkInterceptor>(); } }
/// <summary> /// Registers if needed. /// </summary> /// <param name="context">The context.</param> public static void RegisterIfNeeded(IOnServiceRegistredContext context) { //满足条件时,将会为该类型注入审计日志拦截器。 if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <AuditingInterceptor>(); } }
/// <summary> /// 注册 /// </summary> /// <param name="context"></param> public static void RegisterIfNeeded(IOnServiceRegistredContext context) { // 如果类型允许被审计日志拦截器所拦截,则在类型关联的拦截器上下文当中添加审计日志拦截器。 if (ShouldIntercept(context.ImplementationType)) { context.Interceptors.TryAdd <AuditingInterceptor>(); } }
public static void RegisterIfNeeded(IOnServiceRegistredContext context) { //为所有继承接口的添加拦截器 var AopTypeArray = new Type[] { typeof(IApplicationService), typeof(IDomainService), typeof(IRepository) }; if (((TypeInfo)context.ImplementationType).ImplementedInterfaces.Any(b => AopTypeArray.Contains(b))) { context.Interceptors.TryAdd <MiniProfilerInterceptor>(); } }
private static bool IsDisabledForAutoMap(IOnServiceRegistredContext context) { return(context.ImplementationType.IsDefined(typeof(DisableAutoHubMapAttribute), true)); }
private static bool IsHubClass(IOnServiceRegistredContext context) { return(typeof(Hub).IsAssignableFrom(context.ImplementationType)); }