How to disable inheritance relationship mapping entityframework core

.net-core entity-framework-core inheritance

Question

[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.

1
2
8/2/2017 1:01:18 PM

Popular Answer

public class Shape
{
   int length;
   int breath;
}

[Table("Rectangle")]
public partial class Rectangle : Shape
{
}

[Table("Rhombus")]
public partial class Rhombus : Shape
{
    int angle;
}
0
4/12/2018 8:33:52 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow