RuntimeModel.AddEntityType Methode

Definition

Überlädt

AddEntityType(String, Type, RuntimeEntityType, Boolean, String, ChangeTrackingStrategy, PropertyInfo, Boolean)

Fügt dem Modell einen Entitätstyp mit einer definierenden Navigation hinzu.

AddEntityType(String, Type, RuntimeEntityType, Boolean, String, ChangeTrackingStrategy, PropertyInfo, Boolean, Object)

Fügt dem Modell einen Entitätstyp mit einer definierenden Navigation hinzu.

AddEntityType(String, Type, RuntimeEntityType, Boolean, String, ChangeTrackingStrategy, PropertyInfo, Boolean)

Fügt dem Modell einen Entitätstyp mit einer definierenden Navigation hinzu.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType AddEntityType (string name, Type type, Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType? baseType = default, bool sharedClrType = false, string? discriminatorProperty = default, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy changeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, System.Reflection.PropertyInfo? indexerPropertyInfo = default, bool propertyBag = false);
abstract member AddEntityType : string * Type * Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType * bool * string * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType
override this.AddEntityType : string * Type * Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType * bool * string * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType
Public Overridable Function AddEntityType (name As String, type As Type, Optional baseType As RuntimeEntityType = Nothing, Optional sharedClrType As Boolean = false, Optional discriminatorProperty As String = Nothing, Optional changeTrackingStrategy As ChangeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, Optional indexerPropertyInfo As PropertyInfo = Nothing, Optional propertyBag As Boolean = false) As RuntimeEntityType

Parameter

name
String

Der Name des hinzuzufügenden Entitätstyps.

type
Type

Die CLR-Klasse, die verwendet wird, um Instanzen dieses Typs darzustellen.

baseType
RuntimeEntityType

Der Basistyp dieses Entitätstyps.

sharedClrType
Boolean

Gibt an, ob dieser Entitätstyp seinen ClrType für andere Entitäten freigeben kann.

discriminatorProperty
String

Der Name der Eigenschaft, die zum Speichern eines Diskriminatorwerts verwendet wird.

changeTrackingStrategy
ChangeTrackingStrategy

Die Änderungsnachverfolgungsstrategie für diesen Entitätstyp

indexerPropertyInfo
PropertyInfo

Die PropertyInfo für den Indexer für den zugeordneten CLR-Typ, sofern vorhanden.

propertyBag
Boolean

Ein Wert, der angibt, ob dieser Entitätstyp über einen Indexer verfügt, der beliebige Eigenschaften enthalten kann, und eine Methode, mit der bestimmt werden kann, ob eine bestimmte Indexereigenschaft einen Wert enthält.

Gibt zurück

Der neue Entitätstyp.

Gilt für:

AddEntityType(String, Type, RuntimeEntityType, Boolean, String, ChangeTrackingStrategy, PropertyInfo, Boolean, Object)

Fügt dem Modell einen Entitätstyp mit einer definierenden Navigation hinzu.

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType AddEntityType (string name, Type type, Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType? baseType = default, bool sharedClrType = false, string? discriminatorProperty = default, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy changeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, System.Reflection.PropertyInfo? indexerPropertyInfo = default, bool propertyBag = false, object? discriminatorValue = default);
abstract member AddEntityType : string * Type * Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType * bool * string * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool * obj -> Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType
override this.AddEntityType : string * Type * Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType * bool * string * Microsoft.EntityFrameworkCore.ChangeTrackingStrategy * System.Reflection.PropertyInfo * bool * obj -> Microsoft.EntityFrameworkCore.Metadata.RuntimeEntityType
Public Overridable Function AddEntityType (name As String, type As Type, Optional baseType As RuntimeEntityType = Nothing, Optional sharedClrType As Boolean = false, Optional discriminatorProperty As String = Nothing, Optional changeTrackingStrategy As ChangeTrackingStrategy = Microsoft.EntityFrameworkCore.ChangeTrackingStrategy.Snapshot, Optional indexerPropertyInfo As PropertyInfo = Nothing, Optional propertyBag As Boolean = false, Optional discriminatorValue As Object = Nothing) As RuntimeEntityType

Parameter

name
String

Der Name des hinzuzufügenden Entitätstyps.

type
Type

Die CLR-Klasse, die verwendet wird, um Instanzen dieses Typs darzustellen.

baseType
RuntimeEntityType

Der Basistyp dieses Entitätstyps.

sharedClrType
Boolean

Gibt an, ob dieser Entitätstyp seinen ClrType für andere Entitäten freigeben kann.

discriminatorProperty
String

Der Name der Eigenschaft, die zum Speichern eines Diskriminatorwerts verwendet wird.

changeTrackingStrategy
ChangeTrackingStrategy

Die Änderungsnachverfolgungsstrategie für diesen Entitätstyp.

indexerPropertyInfo
PropertyInfo

Die PropertyInfo für den Indexer für den zugeordneten CLR-Typ, sofern vorhanden.

propertyBag
Boolean

Ein Wert, der angibt, ob dieser Entitätstyp über einen Indexer verfügt, der beliebige Eigenschaften enthalten kann, und eine Methode, mit der bestimmt werden kann, ob eine bestimmte Indexereigenschaft einen Wert enthält.

discriminatorValue
Object

Der Diskriminatorwert für diesen Entitätstyp.

Gibt zurück

Der neue Entitätstyp.

Gilt für: