How can I disable model compatibility checking in Entity Framework 4.3?

蓝咒 提交于 2019-11-27 04:57:11

Setting the initializer to null will skip the model compatibility check.

Database.SetInitializer<MyContext>(null);

For EF 4.3 or higher

Database.SetInitializer<MLTServerWatcherContext>(null);

Or if using older version of EF

modelBuilder.Conventions.Remove<IncludeMetadataConvention>();

(I know he said he are using EF 4.3, but i think it's good to show this option too)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!