Partager via


Entity Framework and Visual Studio 2015 RC

Today Soma announced the Release Candidate of Visual Studio 2015. Our team is concurrently working on EF6.x and EF7 versions of our product and both of them make an appearance in this release.

 


Entity Framework 6.1.3

EF6.1.3 is the latest stable version of Entity Framework and is the recommended version for production applications. EF6.1.3 is a patch release containing fixes for high priority issues that were reported on EF6.1.2.

Visual Studio 2015 RC includes the RTM version of Entity Framework 6.1.3 runtime and tooling.

  • The runtime will be installed if you create a new model using the Entity Framework Tools in a project that does not already have the EF runtime installed.
  • The runtime is pre-installed in new ASP.NET projects, depending on the project template you select.
  • The EF6.1.3 Tools for Visual Studio 2015 are included to make sure you get the latest bug fixes and improvements.

You can read more about the specific fixes included in EF6.1.3 in our recent announcement post.

 


Entity Framework 7 Beta 4

EF7 will be the next major release of Entity Framework and it is currently in pre-release.

 

Still very much a preview

EF7 introduces some significant changes and improvements over EF6.x and therefore the pre-release phase of EF7 is much longer than other recent releases. We’ve made significant progress since our last pre-release, but if you decide to try out EF7 then please bear in mind that this preview is designed to give you an idea of what the experience will be like and there are still a number of limitations and missing features that will be addressed before RTM.

If you aren’t comfortable working with a prerelease that is still very much in-flux then don’t worry… there will be plenty of opportunity to try out pre-release EF7 once it is much more stable.

 

Where can I use Beta 4?

Beta 4 can be used in the following types of applications

  • ASP.NET 5 applications that target either full .NET or the new .NET Core. EF7 is included in new ASP.NET 5 applications that are created using the “Web Site” project template. The following resources will help you get started using EF7 in ASP.NET 5:
  • WPF, WinForms, Console and ASP.NET 4 applications that target .NET 4.5.1 or later. We only recommend this for trying out EF7 in sample applications. If you are writing a production application then you should continue to use EF6.x. We do not recommend attempting to upgrade an EF6.x application to EF7 at this stage as there are still key features yet to be implemented on EF7 (such as inheritance support which is currently being implemented).
  • Mac and Linux applications targeting Mono 3.12.1 or later can make use of EF7. We have not done extensive testing of this scenario, but basic query and save functionality works.

 

What databases can I target with Beta 4?

Currently you can target SQL Server or our in-memory store (designed to help with testing). These providers are available in the EntityFramework.SqlServer and EntityFramework.InMemory NuGet packages.

We are working on other providers that will be available for the next prerelease (more on that below).

 

What’s implemented in Beta 4?

Here is a rough guide to what currently works in Beta 4. Most of these features are a work-in-progress and still have limitations.

  • Basic modeling including built-in conventions, table/column mapping, and relationships
  • Change tracking
  • LINQ queries
  • Table based Insert/Update/Delete (including batching)
  • Migrations and database creation/deletion
  • Transactions (including automatic transactions during SaveChanges and explicit transaction APIs)
  • Identity and Sequence patterns for database generated key values
  • Raw SQL commands
  • An early preview of reverse engineering a model from a database
  • Logging
  • Unique constraints including the ability to use them as keys in a relationship

 

What’s Next

Here are some of the areas we are currently working on (or working with other development teams to deliver). You can see many of these features already underway in our working code base.

Providers

There is work underway to enable the following database providers. We’ve also had contact with many other providers who are planning to provide EF7 support.

  • SQLite (being developed by the EF team)
  • PostgreSql (being developed by the npgsql team)
  • MySql (being developed by the MySql team)

Platforms

We are working to enable EF7 use on the following platforms:

  • Windows 10 Universal Application Platform
  • Cross-platform .NET for Mac and Linux
  • Android and iOS Mono frameworks

Features

Here are a number of the cross-cutting features we are currently working on. This isn’t all we will be doing for RTM, just what’s currently underway.

  • Inheritance
  • Cascade delete
  • Template-based reverse engineering from a database

Comments

  • Anonymous
    April 29, 2015
    Xamarin.Forms support please!!! :) :) :) :)

  • Anonymous
    April 29, 2015
    FWIW, I am planning a SQL Server Compact provider

  • Anonymous
    April 29, 2015
    Still looks very inferior in terms of features compared to nhibernate. I am disappointed.

  • Anonymous
    April 29, 2015
    "We are working to enable EF7 use on the following platforms:  Windows 10 Universal Application Platform" So I guess support for Windows/Phone 8.1 Universal apps, that was mentioned earlier, won't happen after all?

  • Anonymous
    April 29, 2015
    The comment has been removed

  • Anonymous
    April 29, 2015
    Update-Database, Add-Migration ... do not work in VS 2015 RC.

  • Anonymous
    April 30, 2015
    @MichaelD! - Just demoed some early work on EF7 + Xamarin.Forms at //build... session video will be in the next day or two channel9.msdn.com/.../2-693

  • Anonymous
    April 30, 2015
    @ErikEJ - I was just listing the ones currently underway... saw your post on GitHub about getting started and will follow up once //build and Ignite are done :)

  • Anonymous
    April 30, 2015
    @OnurG - Any specific areas that you think need to be addressed?

  • Anonymous
    April 30, 2015
    @Martin Suchan - We're not sure about win81/wpa81 support yet. Our first priority is Windows 10 UAP but by the time we support all the listed platforms it may be that win81/wpa81 is basically already supported and we get it for free (or at least fairly cheaply).

  • Anonymous
    April 30, 2015
    @James Hancock & @Gigel - Thanks for reporting this... we're investigating at the moment.

  • Anonymous
    April 30, 2015
    The comment has been removed

  • Anonymous
    May 01, 2015
    Thanks Rowan for engaging your customers!!!  And thanks for Xamarin.Forms support.  I also support your strategy of Windows10 first, Windows H8 (not a typo) second. :P

  • Anonymous
    May 01, 2015
    The traction behind EF is gaining momentum and will no doubt if not already over take NHibernate. With this in mind would the EF team consider looking at some of the obstacles associated with implementing Domain Driven Design with EF. Of course purity can be a massive time sink and development like so much else is about compromise! Still offering the extension points so the community can build a DDD friendly approach to using EF would be a great benefit. Here are two examples: https://vaughnvernon.co/?p=879 and lostechies.com/.../domain-modeling-with-entity-framework-scorecard

  • Anonymous
    May 02, 2015
    What is the status Update-Database and Add-Migration on VS 2015 RC, still getting error that specified by @James Hancock

  • Anonymous
    May 02, 2015
    The comment has been removed

  • Anonymous
    May 03, 2015
    I second the posts of @James Hancock, @Gigel and @Gencebay. Post the install of VS2015 RC, I am unable to perform any Entity Framework (6.1.3) Code First actions, such as Add-Migration and Update-Database. By the looks of it they are currently broken, but no one is saying much about it...

  • Anonymous
    May 03, 2015
    Really hope that there will be support for SQL Server's table valued functions, or extension point that allow them to be added.

  • Anonymous
    May 03, 2015
    @Gigel We're still isolating what the issue is. It doesn't happen on all installs of Visual Studio 2015 RC which is making it harder to isolate. The issue is tracked here github.com/.../1950.

  • Anonymous
    May 05, 2015
    @Gencebay and others.  The issue being reported has a workaround.  Check github.com/.../1950.  I for one found the patched file to work.

  • Anonymous
    May 07, 2015
    You mentioned that batching is supported for insert/update/delete. I'm wondering if the new insert/update/delete code uses prepared commands? This seemed like something obvious that was missing previously. I had to create my own T4 templates for generating CUD methods to do efficient bulk loading. EF was just too slow. I've used Hibernate with Java and found that it used prepared statements and was a lot faster than EF. I looked at the batching specs for EF previously, and it seemed like simply using prepared commands would have given a performance boost and would have been easier to implement.

  • Anonymous
    May 10, 2015
    that's great!!! : )

  • Anonymous
    May 11, 2015
    Is the source for additional providers like Redis available?  Is there any documentation to aid in creating new providers?

  • Anonymous
    May 12, 2015
    The comment has been removed

  • Anonymous
    May 12, 2015
    @Ed Blackburn – We are addressing some of this in the initial release of EF7. But most of them will be addressed in later releases (though we are laying a lot of the groundwork to support them in the current code base).

  • Anonymous
    May 12, 2015
    @Gencebay @Brendan Green @Gigel @James Hancock – Already noted by others, but just to close the loop for other readers, there is an issue filed with NuGet to get this fixed and a workaround listed on our GitHub site github.com/.../1950

  • Anonymous
    May 12, 2015
    @Matt – For queries use context.Blogs.FromSql(“<query>”). For commands you need to grab the DbConnection and use that for the moment – db.Database.AsRelational().Connection.DbConnection.

  • Anonymous
    May 12, 2015
    @Vitaliy – We’ll probably do something more first-class, but for the moment the composable raw-SQL support works pretty nicely. var term = "shirt"; var products = db.Products    .FromSql("SELECT * FROM [dbo].[SearchProducts] (@p0)", term)    .OrderBy (p => p.CurrentPrice)    .ToList();

  • Anonymous
    May 12, 2015
    @Jon – No prepared commands at the moment. We may look at it when we get to performance tuning on the update pipeline.

  • Anonymous
    May 12, 2015
    @Andrew – No docs yet (code is churning so quickly that anything we write goes out-of-date straight away). Our providers are open source (github.com/.../EntityFramework) and other provider writers have just being using them as a guide and asking questions as needed.

  • Anonymous
    June 02, 2015
    Does support for Windows 10 Universal Application Platform mean that I can finally connect to SQL Server locally + remotely from a Universal Windows App using EF7 ? I guess this feature won't make it by the time Windows 10 goes RTM.

  • Anonymous
    June 05, 2015
    Good Explanations

  • Anonymous
    June 15, 2015
    Lazy Loading isn't available yet. Right? I like to use this in Master-Detail structure.

  • Anonymous
    June 15, 2015
    Thanks so much guys. EntityFramework 7 is going to be stronger than 6.x. I have just one request: Please plase... Add some way to work (conditionaly) with SQL Server into Universal App (the new UWP), if for example, the device is a Desktop running as a server. On another devices, running on Client, just for access data on the server. Is it possibile? Nowadays, our ERP is running in server and cliente side by a WPF application (and I believe it will continues to be). I would like to see code sharing beetween this server version and cliente ones, with EntityFramework compatibility. If it isn't possible, please, on the future, post any tutorial for help us to archieve this. Keep in mind: Working with SQL Server on a server. Always using entityframework.

  • Anonymous
    June 25, 2015
    Any plans to support Complex Types (similar to Value Object in DDD) ? I'm finding it hard to align my models with DDD in Entity Framework 7...

  • Anonymous
    July 06, 2015
    Is the "Template-based reverse engineering from a database" functionality similar EF Power Tools? (I know EFPT is still in beta..)

  • Anonymous
    July 06, 2015
    Any idea when RTM for EF7 is coming out? At least for .NET with MSSQL.

  • Anonymous
    August 11, 2015
    The comment has been removed

  • Anonymous
    August 16, 2015
    Please try to provide Firebird database :)

  • Anonymous
    October 19, 2015
    @Congratulation  & @J. Portelli – For the moment just SQLite will work. That said, we may be able to make direct connections to a remote database work (after our initial RTM) – though obviously that may not always be the best architecture for an application.

  • Anonymous
    October 19, 2015
    @Henrique Clausing – Lazy loading is not yet implemented. Lazy loading is a common request but is also the number 1 source of performance issues we see and folks are often not aware that they are using it. Based on this we are going to see how we go without it... but will add it if feedback shows that folks really need it.

  • Anonymous
    October 19, 2015
    The comment has been removed

  • Anonymous
    October 19, 2015
    @Mark - You want the Scaffold-DbContext command in Package Manager Console (make sure you have the EntityFramework.Commands package installed).

  • Anonymous
    October 19, 2015
    @Mikko – Our roadmap is public - github.com/.../Roadmap. RTM is currently slated for Q1 next year, though of course that may move a little as we get closer to release.

  • Anonymous
    October 19, 2015
    @Jarek – I think we will remove that restriction when we implement Complex Type support in EF7.

  • Anonymous
    October 19, 2015
    @stho – We are working with a number of provider writers to get implementations for EF7. I would recommend also reaching out to the provider writer yourself to let them know it is something that you want.