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.
Advertisements

4 comments on “EF enums and spatial types on .NET 4

  1. Arthur,

    Do you have any idea when EF6 will be released? I didn´t hear anything about it.
    Some people can be afraid to use EF6 without knowing when it could be released.

    • EF5 has only been RTM for a little while so we’re still a bit away from an RTM of EF6. I don’t have any firm dates I can give you yet. You can of course expect pre-releases, probably later ones with go-lives, before we RTM, but again no firm dates yet.

  2. Daniel says:

    Hello, I’m having trouble setting up navigation with EF 5 code first. Is there an example anywhere showing how to do navigation with the mapping API or an attribute?

    I have a question posted but no replies as of yet.
    http://stackoverflow.com/questions/16719252/ef-5-enum-with-navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s