In my projects, I've utilized EntityFramework as an ORM, and I have no issues utilizing this technology. I've heard that EntityFramework builds proxies. What proxy does this ORM produce, specifically? What does it do? When does EF produce it, too? What does the term "proxy," which is commonly used in ORM themes, really mean?
In the realm of ORM, a proxy is a type that is automatically created and inherits from your domain object type. The proxy represents an instance that just has access to its own ID and has not yet been filled with data from the database. The proxy subclass handles the load from the database whenever a property that is mapped to the database is accessed, making the load invisible to the client code.
When a relationship attribute between two entities is slowly loaded, proxies are often generated. For instance, if you access the
attribute, an Address proxy object is really what is returned. Once you have accessed one of the object's properties (such as
) will cause the Address object itself to load.
In this instruction, see Utilizing Proxy Classes: http://www.asp.net/entity-framework/tutorials/advanced-entity-framework-scenarios-for-an-mvc-web-application.