views:

24

answers:

0

Hi.

Im working on Asp.NET MVC 2 project with EF 4(POCO, Lazy disabled) and have a problem with DynamicProxies generated by EF runtime.

I have strongly typed partial view for EF POCO class ie Property, but from EF context i get Property object wrapped by Dynamic Proxy Class, so after calling RenderPartial i get this error:

The model item passed into the dictionary is of type 'System.Data.Entity.DynamicProxies.Property_3A99F7A8373036F07B8DA663F79779BF4FE2B241564ECC50420D0228E5B35C1E', but this dictionary requires a model item of type 'GenReal.Shared.Entities.Property'.

I dont know how to disable EF to do not use Dynamic Proxies, using interfaces instead of classes did not help.

Thank you