i’m currently building a new private website and now it’s time for building the membership related stuff. i’m going on to build my custom membership system and take a look at the codefirstmembership nuget package (1).
i’m little bit confused about the entities. all members are marked as virtual. what’s the meaning in this context? all entity stuff will be lazy-loaded, but what is the “real” effect in the registration or login process or something else? what’s the difference if i mark the entity members without virtual?
it would be great if someone can shed light on this.
There is no effect in the registration or login process. Membership knows nothing about entities, therefore how your entities are defined has absolutely no effect on how membership works.
In Entity Framework, you can get more efficient change tracking if all your properties are virtual. See the section called “More Efficient Change Tracking with “Change Tracking Proxies” “
http://blogs.msdn.com/b/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx