用EntityFramework循環操作數據時,報了如下錯誤
An error occurred while starting a transaction on the provider connection. See the inner exception for details.
System.InvalidOperationException: 已有打開的與此 Command 相關聯的 DataReader,必須首先將它關閉。
查詢了資料 https://www.cnblogs.com/dongshuangjie/p/4832100.html
發現犯了個 低級錯誤,
千萬不要在Iqueryable查詢句子里面嵌套saveChange。 Iqueryable與Ilist的區別不再啰嗦。