Dependency Injection for Filters with Ninject in MVC3 (rical.blogspot.com)

submitted by ricalrical(26) 7 months, 22 days ago

This article describes how to do filters dependency injection with MVC3 using Ninject.

2 comments |category: |Views: 22

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:

posted by dpetersondpeterson(4397) 7 months, 22 days ago 0

Nice, clean example of dependency injection in ASP.NET MVC. Is there a particular reason you use Ninject instead of some of the other options (Autofac, MEF, Castle)? Does it have better support for MVC?
Thanks for sharing!

Reply

posted by ricalrical(26) 7 months, 21 days ago 0

Thanks dpeterson!
<br>
<br>I haven't tried to use Autofac, MEF or Castle yet.. so not sure whether this is better.
<br>I read many articles written about using Ninject for MVC so I decided to try to use it.. It seems much simpler to setup and use than using Unity Application Block (Unity) especially if use NuGet to install it to the project. Please note also that I use recent Ninject and MVC version 3.
<br>
<br>Other reasons that I use Ninject; it has its own extension for MVC framework and also it's free even for commercial use. This is the link for the MVC extension <a href="https://github.com/ninject/ninject.web.mvc/wiki/MVC3" rel="nofollow" target="_new">https://github.com/ninject/ninject.web.mvc/wiki/MVC3</a>
<br><br>
Hope that helps..

Reply

information Login or create an account to comment on this story