In "MappingEntity" - difference between "EntityType" and "ElementType"?

Dec 17, 2009 at 9:22 PM

I'm beginning to implement many-to-many association sets and am creating a new mapping to do it. I'm trying to determine the usage of MappingEntity's ElementType vs. EntityType. What is the usage of each of these where they need to be differentiated?

Coordinator
Dec 19, 2009 at 3:22 PM

The ElementType is the type that normally appears in the generic type for the table or IEnumerable.  The EntityType is the actual type that the toolkit will create when materializing instances, so it may be a sub type of ElementType.  The typical example is that you want to expose an interface for your entity, but you still need to define a concrete type that the toolkit will construct on your behalf.

Dec 19, 2009 at 11:54 PM

Got it - makes sense.