Interface IConventionDiscriminatorBuilder
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Builders
- Assembly
- Microsoft.EntityFrameworkCore.dll
Provides a simple API surface for setting discriminator values from conventions.
public interface IConventionDiscriminatorBuilder
Remarks
See Model building conventions for more information and examples.
Properties
EntityType
Gets the entity type on which the discriminator is being configured.
IConventionEntityType EntityType { get; }
Property Value
Methods
CanSetIsComplete(bool, bool)
Returns a value indicating whether the discriminator mapping is complete can be set from this configuration source.
bool CanSetIsComplete(bool complete, bool fromDataAnnotation = false)
Parameters
complete
boolThe value indicating if this discriminator mapping is complete.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetValue(IConventionEntityType, object?, bool)
Returns a value indicating whether the discriminator value can be set from this configuration source.
bool CanSetValue(IConventionEntityType entityType, object? value, bool fromDataAnnotation = false)
Parameters
entityType
IConventionEntityTypeThe entity type for which a discriminator value is being set.
value
objectThe discriminator value.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
CanSetValue(object?, bool)
Returns a value indicating whether the discriminator value can be set from this configuration source.
bool CanSetValue(object? value, bool fromDataAnnotation = false)
Parameters
value
objectThe discriminator value.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
HasValue(IConventionEntityType, object?, bool)
Configures the discriminator value to use for entities of the given type.
IConventionDiscriminatorBuilder? HasValue(IConventionEntityType entityType, object? value, bool fromDataAnnotation = false)
Parameters
entityType
IConventionEntityTypeThe entity type for which a discriminator value is being set.
value
objectThe discriminator value.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDiscriminatorBuilder
The same builder so that multiple calls can be chained.
HasValue(object?, bool)
Configures the discriminator value to use.
IConventionDiscriminatorBuilder? HasValue(object? value, bool fromDataAnnotation = false)
Parameters
value
objectThe discriminator value.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDiscriminatorBuilder
The same builder so that multiple calls can be chained.
IsComplete(bool, bool)
Configures if the discriminator mapping is complete.
IConventionDiscriminatorBuilder? IsComplete(bool complete, bool fromDataAnnotation = false)
Parameters
complete
boolThe value indicating if this discriminator mapping is complete.
fromDataAnnotation
boolIndicates whether the configuration was specified using a data annotation.
Returns
- IConventionDiscriminatorBuilder
The same builder so that multiple calls can be chained.