Пример #1
0
 /// <summary>启用NSF对taobao版本的适配
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public static SystemConfigWithCastle NSFAdapter(this SystemConfigWithCastle config)
 {
     config.Resolve(o =>
     {
         var c = o.Container;
         c.Register(Component
                    .For <CodeSharp.ServiceFramework.Interfaces.IRemoteHandle>()
                    .ImplementedBy <ServiceFrameworkAdapter.RemotingHandle>()
                    .IsDefault());
     });
     return(config);
 }
Пример #2
0
        private static void PrepareBaseDependency(SystemConfigWithCastle config, WindsorResolver resolver)
        {
            //基础服务使用全局容器
            var windsor = resolver.Container;

            //注册工厂支持
            //windsor.AddFacility<Castle.Facilities.FactorySupport.FactorySupportFacility>();
            //注册基本拦截器
            windsor.Register(Component.For <ServiceInterceptor>().LifeStyle.Transient);
            //不可使用此方式会引起对象正常依赖行为
            //windsor.RegisterFromInterface(typeof(ServiceInterceptor));
            //注册Configure中完成无容器的默认依赖
            config.ExceptionSystem <DefaultExceptionSystem>();
        }