Is it proper TPT Inheritance I have following model and database created using Entity Framework. Is it proper TPT Inheritance?

Is it possible to make the base class as abstract?

Model



Database



CODE

namespace LijosEF
{
public partial class Book 
{
    public override void Sell()
    {
        this.AvailabilityStatus = "BookSOLD";
    }

}

public partial class DigitalDisc
{
    public override void Sell()
    {
        this.AvailabilityStatus = "DiscSOLD";
    }

}

public partial class SellingItem
{
    public virtual void Sell()
    {
        //Do nothing
    }
}
}


Client

namespace LijosEF
{
class Program
{

    static string connectionStringVal;

    static void Main(string[] args)
    {

        SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder();
        sqlBuilder.DataSource = ".";
        sqlBuilder.InitialCatalog = "LibraryReservationSystem";
        sqlBuilder.IntegratedSecurity = true;

        // Initialize the EntityConnectionStringBuilder.
        EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder();
        entityBuilder.Provider = "System.Data.SqlClient";
        entityBuilder.ProviderConnectionString = sqlBuilder.ToString();
        entityBuilder.Metadata = @"res://*/MyModelFirstTest.csdl|res://*/MyModelFirstTest.ssdl|res://*/MyModelFirstTest.msl";

        connectionStringVal = entityBuilder.ToString();


        //AddBook();
        //AddDisc();

        //MakePurchase();

        int billAmount = GetTotalPurchaseValue(1);

    }


    private static void AddBook()
    {
        using (var db = new MyModelFirstTestContainer(connectionStringVal))
        {
            Book book = new Book();
            book.AvailabilityStatus = "Available";
            book.Price = 150;
            book.Title = "Maths Easy";

            db.SellingItems.AddObject(book);
            db.SaveChanges();

        }

    }

    private static void MakePurchase()
    {

        using (var db = new MyModelFirstTestContainer(connectionStringVal))
        {
            DigitalDisc disc = db.SellingItems.OfType&lt;DigitalDisc&gt;().FirstOrDefault(p =&gt; p.Artist == "Turtle Violin");
            disc.Sell(); //Changes State

            Book book = db.SellingItems.OfType&lt;Book&gt;().FirstOrDefault(p =&gt; p.Title == "Maths Easy");
            book.Sell(); //Changes State

            Purchase purchase = new Purchase();
            purchase.Date = DateTime.Now;
            purchase.SellingItems.Add(book);
            purchase.SellingItems.Add(disc);

            db.Purchases.AddObject(purchase);
            db.SaveChanges();

        }

    }

    private static int GetTotalPurchaseValue(int purchaseID)
    {
        using (var db = new MyModelFirstTestContainer(connectionStringVal))
        {

            var purchase = db.Purchases.FirstOrDefault(p =&gt; p.PurchaseId == purchaseID);
            if( purchase == null)
            {
                return 0;
            }

            var total = purchase.SellingItems.Sum(x =&gt; Convert.ToInt32(x.Price));
            return total;

        }

    }



    private static void AddDisc()
    {


        using (var db = new MyModelFirstTestContainer(connectionStringVal))
        {
            DigitalDisc disc = new DigitalDisc();
            disc.AvailabilityStatus = "Available";
            disc.Price = 300;
            disc.Artist = "Turtle Violin";

            db.SellingItems.AddObject(disc);
            db.SaveChanges();

        }

    }

}
}


REFERENCE:


https://stackoverflow.com/questions/4254182/inheritance-vs-enum-properties-in-the-domain-model/4259033#comment15499738_4259033
https://stackoverflow.com/questions/11683536/entity-framework-get-subclass-objects-in-repository#comment15499860_11683536
https://softwareengineering.stackexchange.com/questions/158472/why-should-i-add-check-constraint
Yes, it is a proper TPT inheritance and yes, you can mark your base class as abstract.