Share via


IConventionModelBuilder.Entity Method

Definition

Overloads

Entity(String, String, IConventionEntityType, Boolean)

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

Entity(Type, String, IConventionEntityType, Boolean)

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

Entity(String, Nullable<Boolean>, Boolean)

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

Entity(Type, Nullable<Boolean>, Boolean)

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

Entity(String, String, IConventionEntityType, Boolean)

Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder Entity (string name, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType definingEntityType, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? Entity (string name, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType definingEntityType, bool fromDataAnnotation = false);
abstract member Entity : string * string * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function Entity (name As String, definingNavigationName As String, definingEntityType As IConventionEntityType, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

name
String

The name of the entity type to be configured.

definingNavigationName
String

The defining navigation.

definingEntityType
IConventionEntityType

The defining entity type.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the entity type if the entity type was added or already part of the model, null otherwise.

Applies to

Entity(Type, String, IConventionEntityType, Boolean)

Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs

Returns an object that can be used to configure a given entity type with defining navigation. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder Entity (Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType definingEntityType, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? Entity (Type type, string definingNavigationName, Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType definingEntityType, bool fromDataAnnotation = false);
abstract member Entity : Type * string * Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function Entity (type As Type, definingNavigationName As String, definingEntityType As IConventionEntityType, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

type
Type

The type of the entity type to be configured.

definingNavigationName
String

The defining navigation.

definingEntityType
IConventionEntityType

The defining entity type.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the entity type if the entity type was added or already part of the model, null otherwise.

Applies to

Entity(String, Nullable<Boolean>, Boolean)

Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided name is not already part of the model, a new shadow entity type will be added to the model.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder Entity (string name, bool? shouldBeOwned = False, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? Entity (string name, bool? shouldBeOwned = False, bool fromDataAnnotation = false);
abstract member Entity : string * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function Entity (name As String, Optional shouldBeOwned As Nullable(Of Boolean) = False, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

name
String

The name of the entity type to be configured.

shouldBeOwned
Nullable<Boolean>

true if the entity type should be owned, false if the entity type should not be owned

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the entity type if the entity type was added or already part of the model, null otherwise.

Applies to

Entity(Type, Nullable<Boolean>, Boolean)

Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs
Source:
IConventionModelBuilder.cs

Returns an object that can be used to configure a given entity type in the model. If an entity type with the provided type is not already part of the model, a new entity type will be added to the model.

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder Entity (Type type, bool? shouldBeOwned = False, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? Entity (Type type, bool? shouldBeOwned = False, bool fromDataAnnotation = false);
abstract member Entity : Type * Nullable<bool> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
Public Function Entity (type As Type, Optional shouldBeOwned As Nullable(Of Boolean) = False, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder

Parameters

type
Type

The type of the entity type to be configured.

shouldBeOwned
Nullable<Boolean>

true if the entity type should be owned, false if the entity type should not be owned

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

An object that can be used to configure the entity type if the entity type was added or already part of the model, null otherwise.

Applies to