MutableModelExtensions.GetOrAddEntityType Method

Definition

Overloads

GetOrAddEntityType(IMutableModel, String)

Gets the entity type with the given name or adds a new entity type if none is found.

GetOrAddEntityType(IMutableModel, Type)

Gets the entity type with the given CLR class or adds a new entity type if none is found.

GetOrAddEntityType(IMutableModel, String)

Gets the entity type with the given name or adds a new entity type if none is found.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType GetOrAddEntityType (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, string name);
static member GetOrAddEntityType : Microsoft.EntityFrameworkCore.Metadata.IMutableModel * string -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
<Extension()>
Public Function GetOrAddEntityType (model As IMutableModel, name As String) As IMutableEntityType

Parameters

model
IMutableModel

The model to find or add the entity type to.

name
String

The name of the entity type.

Returns

The existing or newly created entity type.

Applies to

GetOrAddEntityType(IMutableModel, Type)

Gets the entity type with the given CLR class or adds a new entity type if none is found.

public static Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType GetOrAddEntityType (this Microsoft.EntityFrameworkCore.Metadata.IMutableModel model, Type type);
static member GetOrAddEntityType : Microsoft.EntityFrameworkCore.Metadata.IMutableModel * Type -> Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType
<Extension()>
Public Function GetOrAddEntityType (model As IMutableModel, type As Type) As IMutableEntityType

Parameters

model
IMutableModel

The model to find or add the entity type to.

type
Type

The CLR class of the entity type.

Returns

The existing or newly created entity type.

Applies to