Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model configuration: Set ValueGenerated for store-generated properties using a convention #7205

Closed
AndriySvyryd opened this issue Dec 7, 2016 · 2 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@AndriySvyryd
Copy link
Member

Currently setting DefaultValue, DefaultValueSql, ComputedColumnSql or SqlServer().ValueGenerationStrategy sets ValueGenerated in the Fluent API using ConfigurationSource.Convention.

This means that ValueGenerated is not updated when the mentioned facets are set using the Metadata API.

Also it might get out of date when merging the property facets since it doesn't use the same ConfigurationSource:
If DefaultValue is set by convention on base type, but ComputedColumnSql is set explicitly on base. When the base type is set the property will have ComputedColumnSql configured, but it could still have ValueGenerated set to OnAdd

@divega divega added this to the 2.0.0 milestone Dec 19, 2016
@divega
Copy link
Contributor

divega commented Dec 19, 2016

We should consider looking at other fluent APIs that do multiple things and can switch to using conventions. We should also evaluate if the complexity increase is worth the functional improvement we expect (in this case, mainly it is that setting the value in metadata APIs will have the same observable effect as doing it on the fluent API).

@JackLama
Copy link

More learning, mutual guidance

AndriySvyryd added a commit that referenced this issue Dec 22, 2016
AndriySvyryd added a commit that referenced this issue Dec 22, 2016
AndriySvyryd added a commit that referenced this issue Apr 13, 2017
AndriySvyryd added a commit that referenced this issue Apr 14, 2017
AndriySvyryd added a commit that referenced this issue Apr 14, 2017
@AndriySvyryd AndriySvyryd removed their assignment Apr 14, 2017
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 14, 2017
@ajcvickers ajcvickers changed the title Set ValueGenerated for store-generated properties using a convention Model configuration: Set ValueGenerated for store-generated properties using a convention May 9, 2017
roji added a commit to roji/efcore.pg that referenced this issue Apr 19, 2019
Reacting to dotnet/efcore#7205

Note that this was done a long time ago in EFCore (2.0.0) but only
now discovered thanks to the internal analyzer warnings.
roji added a commit to roji/efcore.pg that referenced this issue Apr 19, 2019
Reacting to dotnet/efcore#7205

Note that this was done a long time ago in EFCore (2.0.0) but only
now discovered thanks to the internal analyzer warnings.
roji added a commit to roji/efcore.pg that referenced this issue Apr 20, 2019
Reacting to dotnet/efcore#7205

Note that this was done a long time ago in EFCore (2.0.0) but only
now discovered thanks to the internal analyzer warnings.
roji added a commit to npgsql/efcore.pg that referenced this issue Apr 21, 2019
Reacting to dotnet/efcore#7205

Note that this was done a long time ago in EFCore (2.0.0) but only
now discovered thanks to the internal analyzer warnings.
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants