[英]Automapper for use with Entity Framework using repository pattern?
[英]Why is there no call to repository's update method for this request (Entity Framework, automapper, repository pattern)?
SaveChangesAsync 如何調用存儲庫上的更新方法?
DbContext是存儲庫,它跟蹤 oldCamp object。 當SaveChagnes () 被調用時,它將檢測到任何被跟蹤實體的更改並采取適當的操作(插入、更新或刪除)。
在后台SaveChangesAsync()
將自動調用DetectChanges()
以在保存到底層數據庫之前發現對實體實例的任何更改。 這可以通過AutoDetectChangesEnabled
禁用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.