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
I would like to implement the schema versioning pattern with for EF Core Cosmos DB.
I do not care about missing properties in queries and indexes and just want to have a full backward compatibility with old versions and avoid service downtime.
So the idea was to add a shadow property "schema_version" to each entity and and to migrate the data if necessary during reading.
Questions:
How to intercept data reading (I need to read and modify a pure JObject before EF builds a real entity from it)
How to intercept data writing to add the shadow property
Thank you.
The text was updated successfully, but these errors were encountered:
For intercept reading I replace CosmosClientWrapper in DbContext and override ExecuteSqlQueryAsync method.
The class is for internal purposes so I would like to have an official way to implement lazy migrations.
For intercept writing I override SaveChangesAsync in DbContext. Due to the bug that HasValueGenerator does not affect Update despite of configuring together with ValueGeneratedOnAddOrUpdate I have to set values for modified entities in SaveChangesAsync.
It would be good to see ValueGeneratedOnAddOrUpdate behaves as expected (not as ValueGeneratedOnAdd).
Hello,
I would like to implement the schema versioning pattern with for EF Core Cosmos DB.
I do not care about missing properties in queries and indexes and just want to have a full backward compatibility with old versions and avoid service downtime.
So the idea was to add a shadow property "schema_version" to each entity and and to migrate the data if necessary during reading.
Questions:
Thank you.
The text was updated successfully, but these errors were encountered: