Condividi tramite


RelationalAdHocMapper Class

Definition

Creates ad-hoc mappings of CLR types to entity types after the model has been built.

public class RelationalAdHocMapper : Microsoft.EntityFrameworkCore.Metadata.AdHocMapper
type RelationalAdHocMapper = class
    inherit AdHocMapper
Public Class RelationalAdHocMapper
Inherits AdHocMapper
Inheritance
RelationalAdHocMapper

Remarks

The service lifetime is Scoped. This means that each DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.

See Implementation of database providers and extensions for more information and examples.

Constructors

RelationalAdHocMapper(AdHocMapperDependencies, RelationalAdHocMapperDependencies)

Do not call this constructor directly from either provider or application code as it may change as new dependencies are added. Instead, use this type in your constructor so that an instance will be created and injected automatically by the dependency injection container. To create an instance with some dependent services replaced, first resolve the object from the dependency injection container, then replace selected services using the C# 'with' operator. Do not call the constructor at any point in this process.

Properties

Dependencies

Dependencies for this service.

(Inherited from AdHocMapper)
RelationalDependencies

Relational-specific dependencies for this service.

Methods

BuildConventionSet()

Builds the convention set to be used by the ad-hoc mapper.

GetOrAddEntityType(Type)

Gets the ad-hoc entity type mapped for the given CLR type, or creates the mapping and returns it if it does not exist.

(Inherited from AdHocMapper)

Applies to