RelationalEntityTypeBuilderExtensions RelationalEntityTypeBuilderExtensions Class

Definition

Relational database specific extension methods for EntityTypeBuilder.

public static class RelationalEntityTypeBuilderExtensions
Public Module RelationalEntityTypeBuilderExtensions
Inheritance
System.ObjectSystem.Object
RelationalEntityTypeBuilderExtensionsRelationalEntityTypeBuilderExtensions

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

HasDiscriminator(EntityTypeBuilder) HasDiscriminator(EntityTypeBuilder)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

public static DiscriminatorBuilder HasDiscriminator(this EntityTypeBuilder entityTypeBuilder)
<ExtensionAttribute>
Public Shared Function HasDiscriminator(entityTypeBuilder As EntityTypeBuilder) As DiscriminatorBuilder
Parameters
entityTypeBuilder
EntityTypeBuilder EntityTypeBuilder

The builder for the entity type being configured.

Returns

A builder that allows the discriminator column to be configured.

HasDiscriminator(EntityTypeBuilder, String, Type) HasDiscriminator(EntityTypeBuilder, String, Type)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

public static DiscriminatorBuilder HasDiscriminator(this EntityTypeBuilder entityTypeBuilder, string name, Type discriminatorType)
<ExtensionAttribute>
Public Shared Function HasDiscriminator(entityTypeBuilder As EntityTypeBuilder, name As String, discriminatorType As Type) As DiscriminatorBuilder
Parameters
entityTypeBuilder
EntityTypeBuilder EntityTypeBuilder

The builder for the entity type being configured.

name
System.String System.String

The name of the discriminator column.

discriminatorType
System.Type System.Type

The type of values stored in the discriminator column.

Returns

A builder that allows the discriminator column to be configured.

HasDiscriminator(EntityTypeBuilder, String) HasDiscriminator(Of TDiscriminator)(EntityTypeBuilder, String)

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

public static DiscriminatorBuilder<TDiscriminator> HasDiscriminator<TDiscriminator>(this EntityTypeBuilder entityTypeBuilder, string name)
<ExtensionAttribute>
Public Shared Function HasDiscriminator(Of TDiscriminator)(entityTypeBuilder As EntityTypeBuilder, name As String) As DiscriminatorBuilder(Of TDiscriminator)
Type Parameters
TDiscriminator

The type of values stored in the discriminator column.

Parameters
entityTypeBuilder
EntityTypeBuilder EntityTypeBuilder

The builder for the entity type being configured.

name
System.String System.String

The name of the discriminator column.

Returns
DiscriminatorBuilder<TDiscriminator> DiscriminatorBuilder(Of TDiscriminator)

A builder that allows the discriminator column to be configured.

HasDiscriminator(EntityTypeBuilder, Expression<>>) HasDiscriminator(Of TEntity, TDiscriminator)(EntityTypeBuilder(Of TEntity), Expression(Of Func(Of TEntity, TDiscriminator)))

Configures the discriminator column used to identify which entity type each row in a table represents when an inheritance hierarchy is mapped to a single table in a relational database.

public static DiscriminatorBuilder<TDiscriminator> HasDiscriminator<TEntity, TDiscriminator>(this EntityTypeBuilder<TEntity> entityTypeBuilder, Expression<Func<TEntity, TDiscriminator>> propertyExpression)where TEntity : class
<ExtensionAttribute>
Public Shared Function HasDiscriminator(Of TEntity As Class, TDiscriminator)(entityTypeBuilder As EntityTypeBuilder(Of TEntity), propertyExpression As Expression(Of Func(Of TEntity, TDiscriminator))) As DiscriminatorBuilder(Of TDiscriminator)
Type Parameters
TEntity

The entity type being configured.

TDiscriminator

The type of values stored in the discriminator column.

Parameters
entityTypeBuilder
EntityTypeBuilder<TEntity> EntityTypeBuilder(Of TEntity)

The builder for the entity type being configured.

propertyExpression
System.Linq.Expressions.Expression<System.Func<TEntity, TDiscriminator>> System.Linq.Expressions.Expression(Of System.Func(Of TEntity, TDiscriminator))

A lambda expression representing the property to be used as the discriminator ( blog => blog.Discriminator).

Returns
DiscriminatorBuilder<TDiscriminator> DiscriminatorBuilder(Of TDiscriminator)

A builder that allows the discriminator column to be configured.

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object

ToTable(EntityTypeBuilder, String) ToTable(EntityTypeBuilder, String)

Configures the table that the entity maps to when targeting a relational database.

public static EntityTypeBuilder ToTable(this EntityTypeBuilder entityTypeBuilder, string name)
<ExtensionAttribute>
Public Shared Function ToTable(entityTypeBuilder As EntityTypeBuilder, name As String) As EntityTypeBuilder
Parameters
entityTypeBuilder
EntityTypeBuilder EntityTypeBuilder

The builder for the entity type being configured.

name
System.String System.String

The name of the table.

Returns

The same builder instance so that multiple calls can be chained.

ToTable(EntityTypeBuilder, String, String) ToTable(EntityTypeBuilder, String, String)

Configures the table that the entity maps to when targeting a relational database.

public static EntityTypeBuilder ToTable(this EntityTypeBuilder entityTypeBuilder, string name, string schema)
<ExtensionAttribute>
Public Shared Function ToTable(entityTypeBuilder As EntityTypeBuilder, name As String, schema As String) As EntityTypeBuilder
Parameters
entityTypeBuilder
EntityTypeBuilder EntityTypeBuilder

The builder for the entity type being configured.

name
System.String System.String

The name of the table.

schema
System.String System.String

The schema of the table.

Returns

The same builder instance so that multiple calls can be chained.

ToTable(EntityTypeBuilder, String) ToTable(Of TEntity)(EntityTypeBuilder(Of TEntity), String)

Configures the table that the entity maps to when targeting a relational database.

public static EntityTypeBuilder<TEntity> ToTable<TEntity>(this EntityTypeBuilder<TEntity> entityTypeBuilder, string name)where TEntity : class
<ExtensionAttribute>
Public Shared Function ToTable(Of TEntity As Class)(entityTypeBuilder As EntityTypeBuilder(Of TEntity), name As String) As EntityTypeBuilder(Of TEntity)
Type Parameters
TEntity

The entity type being configured.

Parameters
entityTypeBuilder
EntityTypeBuilder<TEntity> EntityTypeBuilder(Of TEntity)

The builder for the entity type being configured.

name
System.String System.String

The name of the table.

Returns
EntityTypeBuilder<TEntity> EntityTypeBuilder(Of TEntity)

The same builder instance so that multiple calls can be chained.

ToTable(EntityTypeBuilder, String, String) ToTable(Of TEntity)(EntityTypeBuilder(Of TEntity), String, String)

Configures the table that the entity maps to when targeting a relational database.

public static EntityTypeBuilder<TEntity> ToTable<TEntity>(this EntityTypeBuilder<TEntity> entityTypeBuilder, string name, string schema)where TEntity : class
<ExtensionAttribute>
Public Shared Function ToTable(Of TEntity As Class)(entityTypeBuilder As EntityTypeBuilder(Of TEntity), name As String, schema As String) As EntityTypeBuilder(Of TEntity)
Type Parameters
TEntity

The entity type being configured.

Parameters
entityTypeBuilder
EntityTypeBuilder<TEntity> EntityTypeBuilder(Of TEntity)

The builder for the entity type being configured.

name
System.String System.String

The name of the table.

schema
System.String System.String

The schema of the table.

Returns
EntityTypeBuilder<TEntity> EntityTypeBuilder(Of TEntity)

The same builder instance so that multiple calls can be chained.