I'm using Entity Framework beta 8 and Code First to work with SQLite Database.
I need to have TPH inheritance, but by default it uses TPT inheritance.
Here is a part of my code:
public abstract partial class Amenity
{
[Key]
public int AmenityId { get; set; }
public string AmenityName { get; set; }
}
public class AmenityCountable : Amenity
{
public int AmenityMinValue { get; set; }
public int AmenityMaxValue { get; set; }
public string AmenityTypeName { get; set; }
}
public class AmenityOptionable : Amenity
{
public bool CanHaveMultipleValues { get; set; }
}
public class KMContext : DbContext
{
public virtual DbSet<Amenity> Amenities { get; set; }
public virtual DbSet<AmenityCountable> AmenityCountable { get; set; }
public virtual DbSet<AmenityOptionable> AmenityOptionable { get; set; }
}
How do I modify it so that it uses TPH inheritance?
TPH will be available in the RC release
see github entityframework about TPH