Skip to content

Ensure that facets specified in the store type name take precedence - #29628

Merged
ajcvickers merged 3 commits into
mainfrom
JustMyType1118
Nov 30, 2022
Merged

ajcvickers merged 3 commits into
mainfrom
JustMyType1118

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Fixes #29600.

Using a store type name always overrides any other configuration of the type, since it is has ultimate fidelity of what the database supports. Previously, we were overriding facets set in the store type with those configured by data annotations of the model building API.

This change uses -1 to represent an explicitly configured "max" length, as opposed to no length configured, which is consistent with ADO.NET and EF6. Filed #29627 to make this first-class.

Fixes #29600.

Using a store type name always overrides any other configuration of the type, since it is has ultimate fidelity of what the database supports. Previously, we were overriding facets set in the store type with those configured by data annotations of the model building API.

This change uses -1 to represent an explicitly configured "max" length, as opposed to no length configured, which is consistent with ADO.NET and EF6. Filed #29627 to make this first-class.
@ajcvickers
ajcvickers requested a review from a team November 20, 2022 10:03
Comment thread src/EFCore/Storage/TypeMappingInfo.cs Resolved
@ajcvickers
ajcvickers merged commit 8dc20a6 into main Nov 30, 2022
@ajcvickers
ajcvickers deleted the JustMyType1118 branch November 30, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HasPrecision overrides precision set in explicit store type

2 participants