EF Core 和 EF6:哪一個適合您EF Core and EF6: Which One Is Right for You

下列資訊將協助您在 Entity Framework Core 和 Entity Framework 6 之間選擇。The following information will help you choose between Entity Framework Core and Entity Framework 6.

新應用程式的指引Guidance for new applications

若您希望能利用 EF Core 的所有功能,且您的應用程式不需要尚未在 EF Core 中實作的任何功能,請考慮為新的應用程式使用 EF Core。Consider using EF Core for new applications if you want to take advantage of the all the capabilities of EF Core and your application does not require any features that are not yet implemented in EF Core.

EF6 需要 .NET Framework 4.0 (或更新版本) 且只受 Windows 支援 (亦即其目前無法在 .NET Core 上執行且不受其他作業系統支援),但對於新的應用程式而言,只要這些限制可接受,且應用程式不需要 EF Core 中 EF6 無法使用的新功能,仍然是可行的選擇。EF6 requires .NET Framework 4.0 (or a later version) and is only supported on Windows (that is, EF6 does not currently run on .NET Core and is not supported in other operating systems), but it is still a viable choice for new applications as long those constraints are acceptable and the application does not require new features in EF Core that are not available to EF6.

檢閱功能比較,以了解 EF Core 是否適合您的應用程式。Review Feature Comparison to see if EF Core may be a suitable choice for your application.

現有 EF6 應用程式的指引Guidance for existing EF6 applications

因為 EF Core 在本質上有所變更,我們不建議嘗試將 EF6 應用程式移至 EF Core,除非您有充足的理由進行該變更。Because of the fundamental changes in EF Core we do not recommend attempting to move an EF6 application to EF Core unless you have a compelling reason to make the change. 如果您想要移至 EF Core 來使用新功能,則在開始之前,請務必確認已了解其限制。If you want to move to EF Core to make use of new features, then make sure you are aware of its limitations before you start. 檢閱功能比較,以了解 EF Core 是否適合您的應用程式。Review Feature Comparison to see if EF Core may be a suitable choice for your application.

您應該將從 EF6 移至 EF Core 視為移植,而非升級。You should view the move from EF6 to EF Core as a port rather than an upgrade. 如需詳細資訊,請參閱從 EF6 移植到 EF CoreSee Porting from EF6 to EF Core for more information.