Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Mar 08, 2012 05:50 PM|LINK
Perfect, I found what happened. I changed edmx file properties to the following details and it was recongnized in container.registertype: 1- Code generation move to: Default 2- lazyloading : false and it worked. Additionally
paul hiles of unity.mvc3 responded:
"Most of the examples use DbContext as you say but there is nothing in Unity.Mvc3 that ties you to using Code First. For EF with edmx files, you will have an auto-generated ObjectContext implementation instead of a DbContext. This implements IDisposable
so needs to be treated in the same way as a DbContext. This means that you should register it with Unity using the HierarchicalLifetimeManager. e.g.
container.RegisterType<ObjectContext, MyDbEntities>( new HierarchicalLifetimeManager());"