有没有办法使用Spring.NET获取接口的字符串表示?
在代码中:
typeof(ISsoUrlTemplateRepository).Name我需要在Spring.NET配置中使用此名称...我可以只获取字符串本身,但是如果我重构并更改一些接口的名称,Spring配置将不再有效。
这与我问过的另一个问题有关--> Configure static properties with spring.NET
发布于 2010-01-13 16:03:26
要在Spring.NET配置中获取typename,您需要使用Spring.NET语言。
如下所示:
<object id="MyClass" type="Assembly.Type, Assembly">
<property name ="MyTypeProperty" value="T(AnotherAssembly.AnotherType, AnotherAssembly)"/>
</object>发布于 2010-01-11 04:04:15
通过使用
typeof(ISsoUrlTemplateRepository).AssemblyQualifiedName它包括完整的类型名称,以及从中加载该类型的程序集名称。
https://stackoverflow.com/questions/2038336
复制相似问题