Entity Framework 6.0
EF enums and spatial types on .NET 4
In EF5 some features (such as enums and spatial types) are only available when targeting .NET 4.5. This is because EF5 relies on core EF libraries in the .NET Framework. With EF6 this changes because the core EF code is now included in EntityFramework.dll and recent commits to the code make all EF features (except async) available on .NET 4. This includes enums, spatial support, TVFs, auto-compiled queries and other EF perf improvements, together with many smaller changes/bug fixes in the core code.
How do I get it?At the time of writing EF6 is still being developed but you can easily get prerelease builds in two ways:
- Nightly builds are available as a NuGet feed from myget.org. It's really easy to set up a package source in Visual Studio to get these builds and they are also fully signed.
- Set up a build machine and build EF6 yourself. Use this approach if you want to browse or modify the source or make contributions back to EF.
What else do I need to know?There are a few things you should keep in mind when using EF6:
- EF6 is still being actively developed and we will add/remove/change behavior as we iterate on the development. That being said, the nightly builds are generally very usable for non-production environments, and if you find things that don't work then please let us know!
- The move out of the .NET Framework necessitated some breaking changes. Be sure to read this post on updating EF applications to work with EF6.
- EF6 doesn't yet work in partial trust environments.
- The only providers currently available for EF6 are for SQL Server and SQL Server Compact Edition.
- Task-based async support still requires .NET 4.5. This is because it relies on low-level support in the System.Data assembly.