A column in our API tables is set as follows in Entity Framework. The underlying Oracle database also has a formula for generating a number if passed "0". What does StoreGeneratedPattern mean?
Since this design, there's been a request to bulk import records to this table from another system. However, it's required to 1. use the API to do the import and 2. preserve the value that was present in the old system for this column. That means I need to be able to write to the column, and if the value is null or 0, generate a new value automatically.
The problem I'm having is that while I'm writing the invoice number in the logic, when SaveChangesAsync() is called on the model, this value is being replaced by auto-incrementation. The mapping service that converts our ViewModel to the EF model is indeed writing the new number to the EF model, but it's not being saved. How can I achieve the intended functionality?