Binding to a Derived Type
Binding derived types
Although we have focused on interfaces (since that's most relevant in MVC applications), we can also
Use the Ninject to bind concrete classes.
We focus on this interface (which is important in the MVC application) and can also use Ninject to bind the specific class
In the previous section, we showed the bind a concrete
class to itself, but we can also bind a concrete class to a derived class.
The previous section has shown how to bind a specific class, but now also binds a derived class.
Listing 6-15 shows a ShoppingCart
Class that have been modified to support easy derivation, and a derived class, Limitshoppingcart, which
Enhances its parent is excluding all items whose the value exceeds a specified price limit.
The ShoppingCart is modified to support simple derivation,
Limitshoppingcart, raising its parent class, excluding all items, these items exceed a special price limit.
It's almost time to get off work. Section: Pro ASP. NET MVC 3 Framework