How to use Ninject with ASP.NET MVC(codeclimber.net.nz)

submitted by justin_etheredgejustin_etheredge(8539) 3 years, 3 months ago

By default, the ASP.NET MVC framework instantiate controllers calling their default constructor. This makes using Dependency Injection impossible. But, as almost everything inside that framework, the logic with which a controller is instantiated can be replaced with you own logic. This can be done creating your own ControllerFactory, which is pretty simple. But if you are using one of the many popular DI/IoC libraries, that task is even simpler, since there are already custom controller factories for almost all the IoC libraries available. In this post we are are going to see how to use the ControllerFactory that delegates to Ninject the creation of your controllers.

add a comment |category: |Views: 238

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story