加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 使用NInject连接依赖项的选项

发布时间:2020-12-16 00:10:49 所属栏目:asp.Net 来源:网络整理
导读:使用NInject(最好是2.0),我们在Web应用程序中连接对象依赖项时有哪些选项? 它们可以在XML配置文件中定义吗? 还是必须通过代码完成? 解决方法 Ninject没有XML配置,对不起但我无法提供直接链接(因为他们的网站有flash元素),但这里是 ninject.org的报价: Fr
使用NInject(最好是2.0),我们在Web应用程序中连接对象依赖项时有哪些选项?

它们可以在XML配置文件中定义吗?

还是必须通过代码完成?

解决方法

Ninject没有XML配置,对不起但我无法提供直接链接(因为他们的网站有flash元素),但这里是 ninject.org的报价:

Free yourself from XML

Most other .NET dependency injection frameworks are designed around the use of XML to declare type bindings. Rather than forcing you to write cumbersome and error-prone text,Ninject arms you with a fluent interface,which lets you connect the pieces of your application using full-fledged code. This means you can take advantage of the features of the IDE and compiler,like code completion and type-safety.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读