我们需要设置哪个标志来确保 EF Plus 的社区版本?

Which flag we need to set to ensure community version of EF Plus?

有了 recent changes in Entity Framework Plus,现在依赖于 EF Extensions,我们如何确保开发人员使用免费的社区功能?

我注意到有两个标志

        EntityFrameworkManager.IsEntityFrameworkPlus
        EntityFrameworkManager.IsCommunity

如果我们使用 EF 6 的 EF Plus 社区版本,那么我们需要设置哪个标志以确保我们不会意外使用付费功能?

为确保您只使用免费功能,您需要此代码:

EntityFrameworkManager.IsCommunity = true

这段代码有点隐藏在下载页面的底部:https://entityframework-plus.net/download

编辑:回复评论

Silly question, but where does one place that setting?

任何只被调用一次的地方。以下是一些建议:

  • Web 应用程序:在 global.asax
  • 中使用 Application_Start
  • WinForm App:使用主线程方法
  • Win 服务:使用 OnStart 方法