c# - unity or unity.mvc4 for MVC4 application -


i wanted add di class library part of mvc4 web application. had option of unity, structuremap, ninject. chose unity because mentioned in asp.net sample.

when searched nuget unity see there multiple variation of unity. 1 suitable library, unity or unity.mvc4

you want add unity.mvc4 package, since provides integration between unity , asp.net mvc 4. however, unity.mvc4 depends on unity, adding both packages.

you need configure integration:

var container = new unitycontainer(); // configure container here (registertype, etc.), make sure mvc 4 uses unity... dependencyresolver.setresolver(new unity.mvc4.unitydependencyresolver(container)); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -