Build an MVC Dependency injection Setting up MVC Dependency injection Proficient asp-net-mvc-5-Freeman

Source: Internet
Author: User

The result of the three steps I showed you on the previous section are that the knowledge about the implementation class th At should is instantiated to fulfill requests for the Ivaluecalculator interface have been set up in Ninject.
The result is three steps, and the previous section uses Ninject to instantiate the Ivaluecalculator interface

Of course, I has not improved my application because that knowledge remains defined in the Home controller, meaning that The Home controller is a still tightly coupled to the Linqvaluecalculator class.

Of course I didn't upgrade my application because the home controller has a definition, and the home controller uses the Linqvaluecalculator class

In the following sections, I'll show you what to embed Ninject at the heart of the MVC application, which'll allow me t O Simplify the controller, expand the influence Ninject have so, it works across the app, and move the configuration OU T of the Controller.

The next section will show how to embed Ninject in an MVC application, a simple controller,
The extension affects the Ninject, separating the configuration from the controller.

Translation of the Rotten street WOW

Dizzy Death

Build an MVC Dependency injection Setting up MVC Dependency injection Proficient asp-net-mvc-5-Freeman

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.