EF Code First: is good to call DetectChanges just before SaveChanges?

后端 未结 2 1613
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 09:36

I have read few articles (article1, article2) about Entity Framework that it calls DetectChanges many times, which makes it very slow when working with large amounts of data

2条回答
  •  感动是毒
    2020-12-29 10:31

    One of the main problems that can be resolved by DetectChanges is persisting data in EF when we have ManyToMany relation and AutoDetectChanges=false.

提交回复
热议问题