-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Make StoreGeneratedAlways the default for computed columms #7914
Labels
breaking-change
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
providers-beware
type-enhancement
Milestone
Comments
ajcvickers
added a commit
that referenced
this issue
May 20, 2017
Part of issue #7913 This change obsoletes ReadOnlyBeforeSave, ReadOnlyAferSave, and StoreGeneratedAlways into two unified facets--one for before-save behavior (Added objects) and one for after-save behavior. In each case the property value can be: - Ignore: value never sent to database. (Equivalent to StoreGeneratedAlways, but can apply to any property and can be set differently for before and after save.) - Throw: any non-CLR default value set or property marked as modified causes exception. (Equivalent to previous read-only behaviors.) - UseValue: the value is used if it has been set (to non-CLR default for store-generated) or marked as modified. Also covers issue #7914 - makes Ignore the default for before and after save when using AddOrUpdate (computed) properties.
ajcvickers
added a commit
that referenced
this issue
May 20, 2017
Part of issue #7913 This change obsoletes ReadOnlyBeforeSave, ReadOnlyAferSave, and StoreGeneratedAlways into two unified facets--one for before-save behavior (Added objects) and one for after-save behavior. In each case the property value can be: - Ignore: value never sent to database. (Equivalent to StoreGeneratedAlways, but can apply to any property and can be set differently for before and after save.) - Throw: any non-CLR default value set or property marked as modified causes exception. (Equivalent to previous read-only behaviors.) - UseValue: the value is used if it has been set (to non-CLR default for store-generated) or marked as modified. Also covers issue #7914 - makes Ignore the default for before and after save when using AddOrUpdate (computed) properties.
ajcvickers
added a commit
that referenced
this issue
May 23, 2017
Part of issue #7913 This change obsoletes ReadOnlyBeforeSave, ReadOnlyAferSave, and StoreGeneratedAlways into two unified facets--one for before-save behavior (Added objects) and one for after-save behavior. In each case the property value can be: - Ignore: value never sent to database. (Equivalent to StoreGeneratedAlways, but can apply to any property and can be set differently for before and after save.) - Throw: any non-CLR default value set or property marked as modified causes exception. (Equivalent to previous read-only behaviors.) - UseValue: the value is used if it has been set (to non-CLR default for store-generated) or marked as modified. Also covers issue #7914 - makes Ignore the default for before and after save when using AddOrUpdate (computed) properties.
ajcvickers
added
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
and removed
needs-design
labels
May 24, 2017
25 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
providers-beware
type-enhancement
Currently applications have to be careful not to mark properties that are "store generated on update" as modified because this will cause the modified value to be sent to the database which almost always causes an exception because updating the computed column is not allowed. This is why we had to introduce the StoreGeneratedAlways flag and set it for concurrency tokens--without it concurrency resolution was just too hard to do.
We should consider making this the default by convention for any property marked ValueGenerated.OnAddOrUpdate. This would match how most people want to use computed columns, while still allowing the ability to use the old behavior if somebody really wants it. Also, it would mean we no longer need to treat concurrency tokens differently. It would be technically a breaking change, but I doubt there is much (any?) real-world code that would break.
Also see #7913 which splits StoreGeneratedAlways into two flags and renames it.
The text was updated successfully, but these errors were encountered: