We can stop creation of proxy in the context constructor by using
this.Configuration.ProxyCreationEnabled = false;
What are the advantages and disadvantages of creating proxies in EF 4.1 ?
Proxies are necessary for two features:
Both these techniques have other requirements:
virtual. Lazy loading must be enabled.virtual.Virtual properties enable dynamic tracking, which notices every time a property is altered. WIthout the virtual keyword, snapshot tracking is used which compares the values of every property with their previous values on DetectChanges(). Which one you should use is a nuanced question.In addition to Previous answer, Runtime use your POCO class using reflection and create a Dynamic Proxy class inheriting your POCO class. So it will add those functionalities + EntityObject functionalities in runtime that will help Dynamic proxies to enable Lazy Loading and Dynamic change Tracking.