How to disable inheritance relationship mapping entityframework core

Viewed 1032
[Table("Rectangle")]
public partial class Rectangle
{
     int length;
   int breath;
}
[Table("Rhombus")]
public partial class Rhombus
{
    int length;
   int breath;
    int angle;
}

just for sake of code reusability i need like this

  [Table("Rhombus")]
   public partial class Rhombus:Rectangle
    {
        int angle;
    }

but it creates discriminator field because of TPH

so how to disable inheritance relationship so that i can extent a entity just for code reusability or any other workaround to achieve this.

2 Answers

Consider using abstract class to disable inheritance.

And as @smit mentioned you may also use an interface instead.

Related