It's almost time to get off work. Section: Pro ASP. NET MVC 3 Framework

Source: Internet
Author: User


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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.