LinqConnect Documentation
In This Topic
    Defining TPH Inheritances
    In This Topic

    Table per hierarchy inheritance is defined using the Map method that returns DiscriminatorConfiguration.

    builder.Entity<TphRoot>()
        .FullTableName(@"TEST.TPHROOTS")
        .PrimaryKey(p => p.Id);
     
    builder.Entity<TphRoot>()
        .Map()
            .Discriminator(p => p.TypeDescr)
            .DiscriminatorValue(@"R")
            .IsInheritanceDefault()
        .MapChild<TphA>()
            .DiscriminatorValue(@"A")
        .MapChild<TphB>()
            .DiscriminatorValue(@"B")
        .MapChild<TphB1>()
            .DiscriminatorValue(@"B1")
        .MapChild<TphB2>()
            .DiscriminatorValue(@"B2");