Thanks Antoine for the tip, I just upgraded a project and this had me stumped. Although this has to be a bug (don't you think?). But at least we can make it work for now.
For the example above, something like this:
internal class ParentmodelConfiguration : BaseEntityConfiguration
// put your mappings here (properties, table, key)
internal class ParentmodelConfiguration<TEntityType> : BaseEntityConfiguration where TEntityType : class
internal ParentmodelConfiguration(ParentmodelType parentModelType)
// would recommend an "int" discriminator
// int discriminatorValue = (int)parentMdoelType;
// but for a bool, you could have this
bool discriminatorValue = parentModelType.Childmodel ? false: true;
this.Map(m => m.Requires("RequiredFlag").HasValue(discriminatorValue));
public enum ParentmodelType
// call it with
Edited byMatt J CSaturday, February 11, 2012 2:22 AM
Saturday, February 11, 2012 1:58 AM
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.