c# - Unity.Mvc vs Unity.Mvc5 differences -


i started learn asp.net mvc 5 , found lot of tutorials using unity ioc container dependency injection.

i followed great video start: https://www.youtube.com/watch?v=e7voso411vs

when looking package install, saw:

enter image description here

i found this tutorial october 2014 shows how use unity.mvc framework. required is:

  1. adding package (automatically adding unityconfig.cs , unitymvcactivator.cs app_start.
  2. create interface (iunitysample example) , implementation
  3. adding constructor homecontroller example takes iunitysample parameter.
  4. and finally, add unityconfig.cs in method registertypes register statement: container.registertype<iunitysample, unitysample>();

no need add in application_start method.

that seems easy , works, more updated tutorials read, shows people using unity.mvc5 package , not unity.mvc.

what should use learn asp.net mvc 5? differences between them? 1 better other?

unity.mvc5 , unity.mvc created 2 different organizations , have different implementations.

unity.mvc5 creates child container per web request. works built-in hierarchicallifetimemanager.

unity.mvc not create child container, instead chose create new lifetimemanager called perrequestlifetimemanager.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -