DbContext SaveChanges Order of Statement Execution
问题 I have a table that has a unique index on a table with an Ordinal column. So for example the table will have the following columns: TableId, ID1, ID2, Ordinal The unique index is across the columns ID1, ID2, Ordinal. The problem I have is that when deleting a record from the database I then resequence the ordinals so that they are sequential again. My delete function will look like this: public void Delete(int id) { var tableObject = Context.TableObject.Find(id); Context.TableObject.Remove