码迷,mamicode.com
首页 > Web开发 > 详细

这个时候 快下班了 我来翻译一段: Pro ASP.NET MVC 3 Framework

时间:2016-05-23 19:02:37      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:


Binding to a Derived Type
绑定派生类型
Although we have focused on interfaces (since that is most relevant in MVC applications), we can also
use Ninject to bind concrete classes.
我们关注这个接口(在mvc 应用里 是意义重要的), 还可以 用Ninject 去绑定这个具体的类


In the previous section, we showed you how to bind a concrete
class to itself, but we can also bind a concrete class to a derived class.

前面章节,已经展示过 怎样去绑定一个具体的类,但是现在还绑定了一个派生类。


Listing 6-15 shows a ShoppingCart
class that has been modified to support easy derivation, and a derived class, LimitShoppingCart, which
enhances its parent by excluding all items whose value exceeds a specified price limit.

ShoppingCart 被修改成支持简单的派生,
LimitShoppingCart, 提高 它的父类, 排除 所有物品 ,这些物品 超过 一个特别价格限制。



这个时候 快下班了 我来翻译一段: Pro ASP.NET MVC 3 Framework

标签:

原文地址:http://www.cnblogs.com/ganmk--jy/p/5520762.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!