dotnet / dotnet/efcore

When the `PropertyDiscoveryConvention` is removed, then also skip call to `ValidatePropertyMapping(model, logger)` in ModelValidator

Open
#33,825 3 comments 0 reactions 1 assignee Claimed by @AndriySvyryd View on GitHub
customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Converting a Database First EF6 project to EF Core. The existing database is the arbiter of truth, NOT the POCOs. Model is fully defined using Fluent API and so have removed the `PropertyDiscoveryConvention` in `ConfigureConventions()` but `ModelValidator` insists that every read/write property be mapped or tagged with `Ignore` or `[NotMapped]` attribute. POCOs contain literally thousands of such properties used for functional or front end purposes that have nothing to do with the model/database (for example, hundreds of Flag type enums associated with read/write boolean properties).

Only run the `ValidatePropertyMapping(model, logger)` method in ModelValidator if `PropertyDiscoveryConvention` is present in the Model Builder's Conventions collection.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.