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

Dec 17, 2009 at 10: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?

Dec 19, 2009 at 4: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 20, 2009 at 12:54 AM

Got it - makes sense.