Skip to content

EF Core: Implement IModelValidator for provider-specific validation #135

Description

@DaveRMaltby

Summary

The EF Core providers do not register a custom IModelValidator. This means provider-specific constraints (e.g., unsupported features like sequences, computed columns, or specific data types) are not validated at model build time.

What's Needed

A custom FileModelValidator that validates:

  • No unsupported column types are used
  • No sequences are configured (not supported by file providers)
  • No computed columns reference unsupported functions
  • Table/column names don't contain characters invalid for filenames
  • Schema names aren't used (file providers are schema-less)

Impact

Without validation, users discover unsupported features at runtime (query failure) rather than at model build time (clear error message). Build-time validation provides a much better developer experience.

Standard Reference

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredDeferred — not addressing now

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions