IMutableModel.AddEntityType Method

Definition

Overloads

AddEntityType(String)

Adds an entity type of default type to the model.

AddEntityType(String, Type)

Adds a shared type entity type to the model.

AddEntityType(Type)

Adds an entity type to the model.

AddEntityType(String, String, IMutableEntityType)

Adds an owned entity type with a defining navigation to the model.

AddEntityType(Type, String, IMutableEntityType)

Adds an owned entity type with a defining navigation to the model.

AddEntityType(String)

Adds an entity type of default type to the model.

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name);
abstract member AddEntityType : string -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String) As IMutableEntityType

Parameters

name
String

The name of the entity to be added.

Returns

The new entity type.

Remarks

Shadow entities are not currently supported in a model that is used at runtime with a DbContext. Therefore, shadow state entity types will only exist in migration model snapshots, etc.

Applies to

AddEntityType(String, Type)

Adds a shared type entity type to the model.

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name, Type type);
abstract member AddEntityType : string * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String, type As Type) As IMutableEntityType

Parameters

name
String

The name of the entity to be added.

type
Type

The CLR class that is used to represent instances of the entity type.

Returns

The new entity type.

Remarks

Shared type entity type is an entity type which can share CLR type with other types in the model but has a unique name and always identified by the name.

Applies to

AddEntityType(Type)

Adds an entity type to the model.

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type clrType);
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type type);
abstract member AddEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
abstract member AddEntityType : Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (clrType As Type) As IMutableEntityType
Public Function AddEntityType (type As Type) As IMutableEntityType

Parameters

clrTypetype
Type

The CLR class that is used to represent instances of the entity type.

Returns

The new entity type.

Applies to

AddEntityType(String, String, IMutableEntityType)

Adds an owned entity type with a defining navigation to the model.

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (string name, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
abstract member AddEntityType : string * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (name As String, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType

Parameters

name
String

The name of the entity type to be added.

definingNavigationName
String

The defining navigation.

definingEntityType
IMutableEntityType

The defining entity type.

Returns

The new entity type.

Applies to

AddEntityType(Type, String, IMutableEntityType)

Adds an owned entity type with a defining navigation to the model.

public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type clrType, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
public Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType AddEntityType (Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType definingEntityType);
abstract member AddEntityType : Type * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
abstract member AddEntityType : Type * string * Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
Public Function AddEntityType (clrType As Type, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType
Public Function AddEntityType (type As Type, definingNavigationName As String, definingEntityType As IMutableEntityType) As IMutableEntityType

Parameters

clrTypetype
Type

The CLR class that is used to represent instances of this entity type.

definingNavigationName
String

The defining navigation.

definingEntityType
IMutableEntityType

The defining entity type.

Returns

The new entity type.

Applies to