通过 Structuremap xml 配置注入空字符串

发布于 2024-08-22 22:21:21 字数 89 浏览 3 评论 0原文

当我在结构图 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴骨ら 2024-08-29 22:21:21

您必须在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文