通过 Structuremap xml 配置注入空字符串
当我在结构图 xml 配置文件中使用以下内容时,就像我根本没有指定 captureFileName 参数一样。
如何注入空字符串?
When I use the following in a structuremap xml config file, it is like I didn't specify the captureFileName parameter at all.
How can I inject an empty string?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在 XML 中将该值指定为 captureFileName="STRING.EMPTY"。这是 StructureMap 中的一个老技巧,用于绕过 XML 将空属性视为不存在的事实。
You must specify the value as captureFileName="STRING.EMPTY" in the XML. Its an old hack in StructureMap to get around the fact that XML treats an empty attribute as non-existent.