Can we use an abstract class as a base class of the hierarchy? Please, add example of the DB settings.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Yes, I've tried this in one of my recently EF Core project.
For the parent class and child classes, it will AS IS what we doing usually.
For example:
```C#
public abstract class Function { ...}
public class Menu : Function {...}
In the DBContext class, we can expose above classes to DBSet, and only need to define the Entity for `<Function>` :
```C#
public class MyDBContext : DbContent
{
public virtual DbSet<Function> Functions { get; set; }
public virtual DbSet<Menu> Menus { get; set; }
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.Entity<Function>(entity =>
{.....});
....
}
But if you want to have any other specific requirements such as Ignore Properties of sub class, you can continue declare these, for example:
C#
modelBuilder.Entity<Memu>().Ignore(e => e.MenuProperty1);
Most helpful comment
Yes, I've tried this in one of my recently EF Core project.
For the parent class and child classes, it will AS IS what we doing usually.
For example:
```C#
public abstract class Function { ...}
public class Menu : Function {...}
But if you want to have any other specific requirements such as Ignore Properties of sub class, you can continue declare these, for example:
C# modelBuilder.Entity<Memu>().Ignore(e => e.MenuProperty1);