public static void RegisterIfNeeded(IOnServiceRegistredContext context)
 {
     if (UnitOfWorkHelper.IsUnitOfWorkType(context.ImplementationType.GetTypeInfo()))
     {
         context.Interceptors.TryAdd <UnitOfWorkInterceptor>();
     }
 }
Пример #2
0
 public static void RegisterIfNeeded(IOnServiceRegistredContext context)
 {
     if (ShouldIntercept(context.ImplementationType))
     {
         context.Interceptors.TryAdd <FeaturesValidationInterceptor>();
     }
 }
Пример #3
0
 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>();
     }
 }
Пример #5
0
 public static void RegisterIfNeeded(IOnServiceRegistredContext context)
 {
     if (ShouldIntercept(context.ImplementationType))
     {
         context.Interceptors.TryAdd <EntityChangedRulesInterceptor>();
     }
 }
Пример #6
0
 public static void RegisterIfNeeded(IOnServiceRegistredContext context)
 {
     if (ShouldIntercept(context.ImplementationType))
     {
         context.Interceptors.TryAdd <DistributedCacheInterceptor> ();
     }
 }
Пример #7
0
 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>();
     }
 }
Пример #10
0
 /// <summary>
 /// 注册
 /// </summary>
 /// <param name="context"></param>
 public static void RegisterIfNeeded(IOnServiceRegistredContext context)
 {
     // 如果类型允许被审计日志拦截器所拦截,则在类型关联的拦截器上下文当中添加审计日志拦截器。
     if (ShouldIntercept(context.ImplementationType))
     {
         context.Interceptors.TryAdd <AuditingInterceptor>();
     }
 }
Пример #11
0
        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));
 }