Exemplo n.º 1
0
            public override IController CreateController(RequestContext requestContext, string controllerName)
            {
                IController controller = base.CreateController(requestContext, controllerName);

                /// 自动装配属性
                /// <para>为属性对象启用代理,并延迟初始化被代理的对象</para>
                DelayProxyUtil.AutowiredProperties(controller);

                return(controller);
            }
Exemplo n.º 2
0
            public IHttpController Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
            {
                IHttpController httpController = this.defaultActivator.Create(request, controllerDescriptor, controllerType);

                if (httpController != null)
                {
                    /// 自动装配属性
                    /// <para>为属性对象启用代理,并延迟初始化被代理的对象</para>
                    DelayProxyUtil.AutowiredProperties(httpController);
                }

                return(httpController);
            }