You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enum properties in subclasses are not recognized when TPH mapping is utilized. This seems to be due to the fact that the FindSchemaMappingFragment in MetadataHander returns null when a child entity type is encountered. I will change to TPT mapping strategy as a workaround.
public abstract class Furniture
{
public int Id { get; set; }
public Pattern Pattern { get; set; }
}
public class Bed : Furniture
{
public MattressType Mattress { get; set; }
}
[Flags]
public enum MattressType
{
Soft = 1,
Firm = 2
}
[Test]
public void FindsReferences_InChildEntityType_TPHMappingStrategy()
{
IList<EnumReference> references;
using (var context = new MagicContext())
{
references = _enumToLookup.FindEnumReferences(context);
}
var mattress = references.Count(r => r.EnumType == typeof(MattressType));
Assert.AreEqual(1, mattress, "Wrong number of Mattress refs found");
}
The text was updated successfully, but these errors were encountered:
Enum properties in subclasses are not recognized when TPH mapping is utilized. This seems to be due to the fact that the FindSchemaMappingFragment in MetadataHander returns null when a child entity type is encountered. I will change to TPT mapping strategy as a workaround.
The text was updated successfully, but these errors were encountered: