Partager via


RelationalModelValidator Class

Definition

The validator that enforces rules common for all relational providers.

public class RelationalModelValidator : Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator
type RelationalModelValidator = class
    inherit ModelValidator
Public Class RelationalModelValidator
Inherits ModelValidator
Inheritance
RelationalModelValidator

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Implementation of database providers and extensions for more information and examples.

Constructors

RelationalModelValidator(ModelValidatorDependencies, RelationalModelValidatorDependencies)

Creates a new instance of RelationalModelValidator.

Properties

Dependencies

Dependencies for this service.

(Inherited from ModelValidator)
RelationalDependencies

Relational provider-specific dependencies for this service.

TypeMapper
Obsolete.

Gets the type mapper.

Methods

GetDefaultColumnValue(IProperty, StoreObjectIdentifier)

Returns the object that is used as the default value for the column the property is mapped to.

IsOwned(Type, IConventionModel)

Returns a value indicating whether that target CLR type would correspond to an owned entity type.

(Inherited from ModelValidator)
IsRedundant(IForeignKey)

Returns a value indicating whether the given foreign key is redundant.

IsRedundant(IForeignKey)

Returns a value indicating whether the given foreign key is redundant.

(Inherited from ModelValidator)
LogShadowProperties(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Logs all shadow properties that were created because there was no matching CLR member.

(Inherited from ModelValidator)
LogShadowProperties(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ThrowPropertyNotMappedException(String, IConventionEntityType, IConventionProperty)

Throws an InvalidOperationException with a message containing provider-specific information, when available, indicating possible reasons why the property cannot be mapped.

ThrowPropertyNotMappedException(String, IConventionEntityType, IConventionProperty)

Throws an InvalidOperationException with a message containing provider-specific information, when available, indicating possible reasons why the property cannot be mapped.

(Inherited from ModelValidator)
ThrowPropertyNotMappedException(String, IConventionTypeBase, IConventionProperty)

Throws an InvalidOperationException with a message containing provider-specific information, when available, indicating possible reasons why the property cannot be mapped.

ThrowPropertyNotMappedException(String, IConventionTypeBase, IConventionProperty)

Throws an InvalidOperationException with a message containing provider-specific information, when available, indicating possible reasons why the property cannot be mapped.

(Inherited from ModelValidator)
Validate(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates a model, throwing an exception if any errors are found.

Validate(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates a model, throwing an exception if any errors are found.

(Inherited from ModelValidator)
Validate(IModel)

Validates a model, throwing an exception if any errors are found.

Validate(IModel)

Validates a model, throwing an exception if any errors are found.

(Inherited from ModelValidator)
ValidateBoolsWithDefaults(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of Boolean properties in the model.

ValidateBoolsWithDefaults(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateChangeTrackingStrategy(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of change tracking in the model.

(Inherited from ModelValidator)
ValidateChangeTrackingStrategy(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateClrInheritance(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of inheritance in the model.

(Inherited from ModelValidator)
ValidateClrInheritance(IModel, IEntityType, HashSet<IEntityType>)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateClrInheritance(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateCompatible(ICheckConstraint, ICheckConstraint, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two check constraints with the same name.

ValidateCompatible(IForeignKey, IForeignKey, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two foreign keys mapped to the same foreign key constraint.

ValidateCompatible(IIndex, IIndex, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two indexes mapped to the same table index.

ValidateCompatible(IKey, IKey, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two keys mapped to the same unique constraint.

ValidateCompatible(IProperty, IProperty, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two properties mapped to the same column.

ValidateCompatible(ITrigger, ITrigger, String, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of two trigger with the same name.

ValidateData(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of data (e.g. seed data) in the model.

ValidateData(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of data (e.g. seed data) in the model.

(Inherited from ModelValidator)
ValidateData(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateDataTypes(IModel)
Obsolete.

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateDbFunctions(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of functions in the model.

ValidateDbFunctions(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateDefaultValuesOnKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of default values in the model.

ValidateDefaultValuesOnKeys(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateDefiningNavigations(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)
Obsolete.

Validates the mapping/configuration of defining navigations in the model.

(Inherited from ModelValidator)
ValidateDefiningNavigations(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateDefiningQuery(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of defining queries in the model.

(Inherited from ModelValidator)
ValidateDiscriminatorValues(IEntityType)

Validates the discriminator and values for all entity types derived from the given one.

(Inherited from ModelValidator)
ValidateDiscriminatorValues(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)
Obsolete.

Validates the mapping/configuration of inheritance in the model.

(Inherited from ModelValidator)
ValidateEntityClrTypes(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates that common CLR types are not mapped accidentally as entity types.

(Inherited from ModelValidator)
ValidateFieldMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of properties mapped to fields in the model.

(Inherited from ModelValidator)
ValidateFieldMapping(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateForeignKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of foreign keys in the model.

(Inherited from ModelValidator)
ValidateForeignKeys(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateIgnoredMembers(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates that no attempt is made to ignore inherited properties.

(Inherited from ModelValidator)
ValidateIndexProperties(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates that the properties of any one index are all mapped to columns on at least one common table.

ValidateInheritanceMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of inheritance in the model.

ValidateInheritanceMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping of inheritance in the model.

(Inherited from ModelValidator)
ValidateInheritanceMapping(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateJsonEntities(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the JSON entities.

ValidateJsonEntityKey(StoreObjectIdentifier, IEntityType)

Validate the key of entity mapped to a JSON column.

ValidateJsonEntityNavigations(StoreObjectIdentifier, IEntityType)

Validates navigations of the entity mapped to a JSON column.

ValidateJsonEntityProperties(StoreObjectIdentifier, IEntityType)

Validate the properties of entity mapped to a JSON column.

ValidateJsonEntityRoot(StoreObjectIdentifier, IEntityType)

Validates the root entity mapped to a JSON column.

ValidateKeylessTypes(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of entity types without keys in the model.

(Inherited from ModelValidator)
ValidateMappingFragments(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the entity type mapping fragments.

ValidateMappingStrategy(IEntityType, String)

Validates that the given mapping strategy is supported

ValidateNoCycles(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of the model for cycles.

(Inherited from ModelValidator)
ValidateNoCycles(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateNoMutableKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of mutable in the model.

ValidateNoMutableKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of mutable in the model.

(Inherited from ModelValidator)
ValidateNoMutableKeys(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateNonNullPrimaryKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates that all trackable entity types have a primary key.

(Inherited from ModelValidator)
ValidateNonNullPrimaryKeys(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateNoShadowEntities(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)
Obsolete.

Validates that the model does not contain any entity types without a corresponding CLR type.

(Inherited from ModelValidator)
ValidateNoShadowEntities(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateNoShadowKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of shadow keys in the model.

(Inherited from ModelValidator)
ValidateNoShadowKeys(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateOwnership(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of ownership in the model.

(Inherited from ModelValidator)
ValidateOwnership(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidatePrimitiveCollections(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping of primitive collection properties the model.

ValidatePrimitiveCollections(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping of primitive collection properties the model.

(Inherited from ModelValidator)
ValidatePropertyMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates property mappings.

(Inherited from ModelValidator)
ValidatePropertyOverrides(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the table-specific property overrides.

ValidateQueryFilters(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of query filters in the model.

(Inherited from ModelValidator)
ValidateQueryFilters(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateQueryTypes(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

(Inherited from ModelValidator)
ValidateRelationships(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates relationships.

(Inherited from ModelValidator)
ValidateSharedCheckConstraintCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of check constraints in a given shared table.

ValidateSharedColumnsCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of properties sharing columns in a given table-like object.

ValidateSharedColumnsCompatibility(IReadOnlyList<IEntityType>, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of properties sharing columns in a given table.

ValidateSharedColumnsCompatibility(IReadOnlyList<IEntityType>, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedForeignKeysCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of foreign keys in a given shared table.

ValidateSharedForeignKeysCompatibility(IReadOnlyList<IEntityType>, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of foreign keys in a given shared table.

ValidateSharedForeignKeysCompatibility(IReadOnlyList<IEntityType>, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedIndexesCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of indexes in a given shared table.

ValidateSharedIndexesCompatibility(IReadOnlyList<IEntityType>, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of indexes in a given shared table.

ValidateSharedIndexesCompatibility(IReadOnlyList<IEntityType>, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedKeysCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of primary and alternate keys in a given shared table.

ValidateSharedKeysCompatibility(IReadOnlyList<IEntityType>, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of primary and alternate keys in a given shared table.

ValidateSharedKeysCompatibility(IReadOnlyList<IEntityType>, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedTableCompatibility(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of shared tables in the model.

ValidateSharedTableCompatibility(IModel)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedTableCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of entity types sharing a given table.

ValidateSharedTableCompatibility(IReadOnlyList<IEntityType>, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of entity types sharing a given table.

ValidateSharedTableCompatibility(IReadOnlyList<IEntityType>, String, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of entity types sharing a given table.

ValidateSharedTableCompatibility(IReadOnlyList<IEntityType>, String)

This API supports the Entity Framework Core infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases.

ValidateSharedTriggerCompatibility(IReadOnlyList<IEntityType>, StoreObjectIdentifier, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of triggers in a given shared table.

ValidateSharedViewCompatibility(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of shared views in the model.

ValidateSharedViewCompatibility(IReadOnlyList<IEntityType>, String, String, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the compatibility of entity types sharing a given view.

ValidateSqlQueries(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of SQL queries in the model.

ValidateStoredProcedures(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the mapping/configuration of stored procedures in the model.

ValidateTriggers(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates that the triggers are unambiguously mapped to exactly one table.

ValidateTriggers(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates triggers.

(Inherited from ModelValidator)
ValidateTypeMappings(IModel, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the type mapping of properties the model.

(Inherited from ModelValidator)
ValidateValueGeneration(IEntityType, IKey, IDiagnosticsLogger<DbLoggerCategory.Model.Validation>)

Validates the key value generation is valid.

Applies to