Spring.net - PropertyRetrievingFactoryObject - property is null

给你一囗甜甜゛ 提交于 2019-12-02 00:53:43

You can use an expression to retrieve an object from the spring context in your constructor argument, something like:

<object name="someObject" singleton="false" 
        type="SomeType.someObject, SomeAssembly">
  <constructor-arg name="authSession" 
                   expression="@(AuthSessionManager).CurrentAuthSession" />
</object>

Expressions are allowed to evaluate to null, so you don't have to tell Spring anything. This worked for me in a simple case (no nested contexts).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!