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
The result is that, 'RowId' was forced to be the same as 'Id' in AutoHistory. Or it will throw Concurrency Exception.
So the AutoHistory looks like this, all records happened to have same 'Id' and 'RowId' will insert with success, others fail with exception.
Root Cause tageted:
SQLite (or EF Core?) somehow regard the 'RowId' equivalent to 'Id' for 'AutoHistory' class, so it forces those 2 values shall be the same, or it will throw out concurrency exception, causing the SQL 'INSERT AutoHisoty...' fail.
Solution:
Change the name of AutoHistory.cs property 'RowId' to 'RowNumber' or other names, then add new migrations and update database, issue was solved.
Ef Core shows the AutoHistory require to have 'rowId' not follow the updated entity's Id, but the 'last_insert_rowid()', what does it mean?
The result is that, 'RowId' was forced to be the same as 'Id' in AutoHistory. Or it will throw Concurrency Exception.
So the AutoHistory looks like this, all records happened to have same 'Id' and 'RowId' will insert with success, others fail with exception.
Wondering that if the 'PrimaryKey' produced the 'RowId' with certain restrictions?
The text was updated successfully, but these errors were encountered: