原文:The instance of entity type 'Menu' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked.

這里記錄一個在使用.net core中ef core執行數據庫操作時遇到的問題: 我在代碼中使用DbContext下的Update方法准備將更改后的數據像這樣步到數據庫: 這是很常見的用法,但沒想到一直報如下錯誤: 使用谷歌翻譯翻譯為: 我的代碼如下: 我通過百度,發現國內網站上沒有出現類似錯誤的記載,最后,我在stackoverflow上看到一段類似問題描述: 該用戶描述,他進行了如下嘗試: 在 ...

2019-06-26 15:01 0 1861 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM