温莎城堡:如何以编程方式注册列表(而不是使用配置文件)
我想使用列表参数注册一个对象,但不使用配置文件。 这是我当前使用的配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<castle>
<components>
<component id="EmailParser"
service="ESImportCommon.Email.IEmailParser, ESImportCommon"
type="ESImportCommon.Email.EmailParser, ESImportCommon">
</component>
</components>
</castle>
I would like to register an object with a list parameter, but without using a configuration file.
this is the configuration file that I currently use:
<?xml version="1.0" encoding="utf-8" ?>
<castle>
<components>
<component id="EmailParser"
service="ESImportCommon.Email.IEmailParser, ESImportCommon"
type="ESImportCommon.Email.EmailParser, ESImportCommon">
</component>
</components>
</castle>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以这样做:
请注意,如果您不想在 Web/应用程序中进行任何配置,则无需将
XmlInterpreter
实例传递给构造函数。配置。You can do it like this:
Note that you don't need to pass an instance of
XmlInterpreter
to the constructor if you do not want any configuration in your web/app.config.