IConventionEntityTypeBuilder.HasDiscriminator Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasDiscriminator(Boolean) |
Configures the discriminator property 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. |
HasDiscriminator(MemberInfo, Boolean) |
Configures the discriminator property 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. |
HasDiscriminator(String, Boolean) |
Configures the discriminator property 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. |
HasDiscriminator(Type, Boolean) |
Configures the discriminator property 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. |
HasDiscriminator(String, Type, Boolean) |
Configures the discriminator property 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. |
HasDiscriminator(Boolean)
Configures the discriminator property 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder HasDiscriminator (bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder? HasDiscriminator (bool fromDataAnnotation = false);
abstract member HasDiscriminator : bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder
Public Function HasDiscriminator (Optional fromDataAnnotation As Boolean = false) As IConventionDiscriminatorBuilder
Parameters
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder that allows the discriminator property to be configured.
Applies to
HasDiscriminator(MemberInfo, Boolean)
Configures the discriminator property 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder HasDiscriminator (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder? HasDiscriminator (System.Reflection.MemberInfo memberInfo, bool fromDataAnnotation = false);
abstract member HasDiscriminator : System.Reflection.MemberInfo * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder
Public Function HasDiscriminator (memberInfo As MemberInfo, Optional fromDataAnnotation As Boolean = false) As IConventionDiscriminatorBuilder
Parameters
- memberInfo
- MemberInfo
The property mapped to the discriminator property.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder that allows the discriminator property to be configured.
Applies to
HasDiscriminator(String, Boolean)
Configures the discriminator property 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder HasDiscriminator (string name, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder? HasDiscriminator (string name, bool fromDataAnnotation = false);
abstract member HasDiscriminator : string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder
Public Function HasDiscriminator (name As String, Optional fromDataAnnotation As Boolean = false) As IConventionDiscriminatorBuilder
Parameters
- name
- String
The name of the discriminator property.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder that allows the discriminator property to be configured.
Applies to
HasDiscriminator(Type, Boolean)
Configures the discriminator property 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder HasDiscriminator (Type type, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder? HasDiscriminator (Type type, bool fromDataAnnotation = false);
abstract member HasDiscriminator : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder
Public Function HasDiscriminator (type As Type, Optional fromDataAnnotation As Boolean = false) As IConventionDiscriminatorBuilder
Parameters
- type
- Type
The type of values stored in the discriminator property.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder that allows the discriminator property to be configured.
Applies to
HasDiscriminator(String, Type, Boolean)
Configures the discriminator property 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 Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder HasDiscriminator (string name, Type type, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder? HasDiscriminator (string name, Type type, bool fromDataAnnotation = false);
abstract member HasDiscriminator : string * Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionDiscriminatorBuilder
Public Function HasDiscriminator (name As String, type As Type, Optional fromDataAnnotation As Boolean = false) As IConventionDiscriminatorBuilder
Parameters
- name
- String
The name of the discriminator property.
- type
- Type
The type of values stored in the discriminator property.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
A builder that allows the discriminator property to be configured.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for