Back to Entityframework

Plug-in APIs - EF Core

entity-framework/core/miscellaneous/plugins.md

latest2.8 KB
Original Source

Plug-in APIs

EF Core extensions often require adding logic to core EF and provider components. This usually requires creating a derived component and replacing the original one in the internal service provider. This gets complicated when multiple extensions want to change the same component. In these cases, we provide plug-in APIs to allow multiple extensions to provide additional logic.

List of services

The following is a list of plug-in APIs.

ServiceDescription
xref:Microsoft.EntityFrameworkCore.Storage.ITypeMappingSourcePluginAdds mappings between .NET types and primitive store types.
xref:Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMappingSourcePluginAdds mappings between .NET types and primitive relational database types.
xref:Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure.IConventionSetPluginAdds model building conventions.
xref:Microsoft.EntityFrameworkCore.Query.IMemberTranslatorPluginAdds SQL translations for .NET properties.
xref:Microsoft.EntityFrameworkCore.Query.IMethodCallTranslatorPluginAdds SQL translations for .NET methods.
xref:Microsoft.EntityFrameworkCore.Query.IAggregateMethodCallTranslatorPluginAdds SQL translations for .NET enumerable methods.
xref:Microsoft.EntityFrameworkCore.Query.IEvaluatableExpressionFilterPluginForces server-eval of certain expressions.
xref:Microsoft.EntityFrameworkCore.Scaffolding.IProviderCodeGeneratorPluginScaffolds provider and DbContext options.

Examples

Here are some extensions making use of these APIs:

ExtensionDescription
Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuiteAdds type mappings and SQL translations for SpatiaLite's types.
Microsoft.EntityFrameworkCore.SqlServer.HierarchyIdAdds type mappings and SQL translations for SQL Server's hierarchyid type.
Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuiteAdds type mappings and SQL translations for SQL Server's geography and geometry types.
EFCore.CheckConstraintsAdds model building conventions for relational database check constraints.
EFCore.NamingConventionsAdds model building conventions for alternative relational database table, column, and constraint names.