How to disable model caching in Entity Framework 6 (Code First approach)

后端 未结 4 458
猫巷女王i
猫巷女王i 2020-12-31 04:36

Following MSDN documentation we can read:

The model for that context is then cached and is for all further instances of the context in the app domain.

4条回答
  •  猫巷女王i
    2020-12-31 04:58

    Maybe old EF4 Docu still in EF6. see modelBuilder.CacheForContextType not available

    See also the DbContext Constructor to pass in a model DbContext Constructor

    I haven't tried it, but theoretically you can pass in a model each time.

提交回复
热议问题