You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TonyValenti I think you're looking for computed columns; e.g. for SQL Server you can define a computed column with the JSON_VALUE() function following a path in another column that contains JSON data.
This is almost exactly what I want, except this is SQL server specific.
Is there an overload that I can provide a func/expression that will allow me to tell EFCore "whenever adding/updating this object, recompute the value of this property with this C# expression"?
Is there an overload that I can provide a func/expression that will allow me to tell EFCore "whenever adding/updating this object, recompute the value of this property with this C# expression"?
No, there's nothing like that (tracked by #11001). However, you can easily check for the database provider being targeted (SQL Server vs. PG or whatever) and vary the computed column SQL definition.
I have a bunch of JSON api results that I want to store in a database.
In my table, I want certain properties to always follow values in my json object this way I have direct, indexable access to certain json properties.
Does EFCore have a way to do this automatically or do I have to roll my own solution?
The text was updated successfully, but these errors were encountered: