ModelValidator Class

Definition

The validator that enforces core rules common for all providers.

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.

public class ModelValidator : Microsoft.EntityFrameworkCore.Infrastructure.IModelValidator
type ModelValidator = class
    interface IModelValidator
Public Class ModelValidator
Implements IModelValidator
Inheritance
ModelValidator
Derived
Implements

Constructors

ModelValidator(ModelValidatorDependencies)

Creates a new instance of ModelValidator.

Properties

Dependencies

Dependencies used to create a ModelValidator

Methods

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.

LogShadowProperties(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

Validate(IModel)

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

Validate(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateChangeTrackingStrategy(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateClrInheritance(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping/configuration of inheritance in the model.

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.

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.

ValidateData(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateDefiningNavigations(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

ValidateDefiningQuery(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

ValidateDiscriminatorValues(IEntityType)

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

ValidateDiscriminatorValues(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)
Obsolete.

Validates the mapping/configuration of inheritance in the model.

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.

ValidateFieldMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateForeignKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

ValidateIgnoredMembers(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates that no attempt is made to ignore inherited properties.

ValidateInheritanceMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping of inheritance in the model.

ValidateKeylessTypes(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateNoCycles(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping/configuration of the model for cycles.

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.

ValidateNoMutableKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping/configuration of mutable in the model.

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.

ValidateNonNullPrimaryKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping/configuration of primary key nullability in the model.

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.

ValidateNoShadowEntities(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateNoShadowKeys(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateOwnership(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the mapping/configuration of ownership in the model.

ValidatePropertyMapping(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates property mappings.

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.

ValidateQueryFilters(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

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

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.

ValidateRelationships(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates relationships.

ValidateTypeMappings(IModel, IDiagnosticsLogger<DbLoggerCategory.Model>)

Validates the type mapping of properties the model.

Applies to