concept inherit class in category entity framework
appears as: inherited classes, inherited classes, inherited class

This is an excerpt from Manning's book Entity Framework Core in Action.
Table per hierarchy —This allows a set of inherited classes to be saved into one table; for instance, classes called Dog,Cat, andRabbitthat inherit from theAnimalclass.
Listing 14.9 The custom SQL Server type-mapping class
public class CustomSqlServerTypeMapper #1 : SqlServerTypeMapper #1 { public CustomSqlServerTypeMapper( #2 RelationalTypeMapperDependencies dependencies) #2 : base(dependencies) {} #2 public override RelationalTypeMapping FindMapping(IProperty property) #3 { var currentMapping = base.FindMapping(property); #4 if (property.ClrType == typeof(string) #5 && property.Name.EndsWith("Ascii")) #5 { var size = currentMapping.Size == null #6 ? "max" #6 : currentMapping.Size.ToString(); #6 return new StringTypeMapping( #7 $"varchar({size})", #7 DbType.AnsiString, true, #7 currentMapping.Size); #7 } return currentMapping; #8 } } #1 Creates a custom type mapper by inheriting the SqlServer type mapper #2 You need to add a constructor that passes the dependencies it needs to the inherited class. #3 You override only the FindMapping method that deals with .NET type to SQL type. All the other mapping methods you leave as is. #4 Gets the mapping that the SQLl Server database provider would normally do. This gives you information you can use. #5 You insert the new rule here. If the property is of .NET type string and the property name ends with Ascii, you want to set it as an SQL varchar instead of the normal SQL nvarchar. #6 You work out the size part of SQL type string—either the size provided, or max if the size is null. #7 Builds StringTypeMapping with the various parts set to a varchar type column—an 8-bit character string #8 If the property didn’t fit the new rule, you want the normal EF Core mapping. You therefore return the SQL type mapping that the base method has calculated.