SynchroniseWithDataContext and inherited entities

Jul 29, 2008 at 3:29 PM
Edited Jul 29, 2008 at 3:33 PM

With inherited entities, i have an exception when call SynchroniseWithDataContext : Could not retrieve a Table for inheritance subtype <InheritedEntityType>, try Table of <BaseEntityType> instead.
I suggest to replace entity.GetType() by a call to a new method entity.GetbaseEntityType()  to find the table in SynchroniseWithDataContext method.

Type GetEntityBaseType() 

Type baseType = this.GetType(); 
while (!(baseType.BaseType == typeof(EntityBase))) 
        baseType = baseType.BaseType;
    return baseType;





Aug 1, 2008 at 10:41 PM
Hi there,

Sorry for the late reply.

I'll take a look at this and get back to you soon.


Aug 8, 2008 at 5:37 AM
Ok, I've had a look at it and come up with a solution very similar to yours.

I've added it the latest checking, please let me know if I've missed something.