報錯信息:
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'StatusId'.
大概意思就是更新數據庫出錯了,字段 StatusId 無效
解決方案:
檢查后發現程序里面數據模型是 StatusId ,而實際數據庫字段已經改名字為 StatusValues
只需要確定一下使用哪個字段,一邊做一下同步修改,使用相同字段就可以了。