-
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
Property defining expressions for update #10862
Comments
This would be super useful and not only for update dates but for a million things. E.g. LastUpdatedBy. |
@ajcvickers Believe me! This is one of the most wanted feature for me in EF Core 5.0. I think this should not take so much time to implement but this would be a very very useful feature and frequently used feature in EF Core. Please implement this is in EF Core 5.0. |
but you can basically implement this by overriding saveChanges and casting your entities to a share base or asking if it has the property and then setting it before change, for example
just saying there are better things to focus energy on in my opinion |
@ajcvickers This can be a very good candidate for EF Core 6.0. |
A common request is to have a server-side auto-generated timestamp for any update. One way this could be implemented is through an expression defined on the property to run when that property is saved to the database. Something like:
or even
which will then be translated.
Note that this is very similar to server-side value conversions--see #10861--except that it may not be a "conversion".
(Doors to manual and cross-check with #10768)
The text was updated successfully, but these errors were encountered: