Open TimSalomons opened 10 months ago
If you want to use EF start to finish, you can make the new properties optional at first, then load all the entities, add values for those new properties, save changes and then make the properties required.
Note from triage: document
I have a type which already exists in my database. We've expanded this type and added new required properties to it. However this causes the deserialization to fail since these properties do no yet exist on existing rows.
Below is a small example of my scenario. How would I go about updating the existing rows/data to match the new contract? Setting default values does not seem to help since the deserialization process will fail before it.
provider and version information
EF Core version: 7.0.11 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 7.0 Operating system: Win11 IDE: Rider 2023.2.1