Aracılığıyla paylaş


Visual Studio “14” CTP 3 and Entity Framework

Today we’re providing a third CTP of the next version of Visual Studio, to gather your early feedback. For more information on this release, see Visual Studio “14” CTPs and the Visual Studio Blog. This post covers the places that Entity Framework is included in the release and some limitations to be aware of when using it.

 

Entity Framework 6.x Tools

There is a bug in the version of the designer included in this CTP that will cause the following error to appear when trying to use the EF Tools.

Method not found: 'Void Microsoft.VisualStudio.PlatformUI.DpiHelper.LogicalToDeviceUnits(System.Windows.Forms.ImageList ByRef, Microsoft.VisualStudio.PlatformUI.ImageScalingModel)'.

To resolve this issue, you will need to install an updated version of the Entity Framework 6.1.1 tools for Visual Studio “14” CTP3.

 

Entity Framework 6.x Runtime

The Entity Framework 6.1.1 runtime is included in a number of places in Visual Studio “14” CTP.

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

 

Entity Framework 7

We recently blogged about our plans for Entity Framework 7. Visual Studio “14” CTP 3 includes an early preview of ASP.NET vNext, which in turn includes a very early build of EF7. The EF7 runtime is installed in new ASP vNext projects that are created.

As with previous CTPs of Visual Studio “14”, this build of EF7 implements basic functionality and there are a number of limitations with the features that are implemented. Please bear in mind that this preview is designed to give you an idea of what the experience will be like and you will quickly hit limitations if you deviate from the code from the default project template.

For more information on what’s included in this build of EF7, see the release notes page on our GitHub project.

We’re making good progress on the EF7 code base, but it is still in the early stages of development. If you want to experiment with a build we would recommend visiting our GitHub wiki for information on using nightly builds.

Comments

  • Anonymous
    August 20, 2014
    I'm taking a look at the new EF7 and I can't see how to update an entity (There is no Attach method on the dbset). Is this functionality yet to be implemented? or is there a new way of doing this?

  • Anonymous
    August 21, 2014
    @Martin - There is a new Update method on DbSet that should do what you are after.

  • Anonymous
    August 22, 2014
    I'm wondering if int.Parse() will work in EF 7 queries?

  • Anonymous
    August 22, 2014
    Does it support table valued functions when using code first?

  • Anonymous
    August 24, 2014
    Thanks Rowan. Does that allow updating a single property rather than the whole entity? Previously I could Attach the entity, change properties and only the properties I changed would get written to the database. Update sets columns to null that I haven't set. I was hoping to avoid having to make a database call to get the full entity in order to update a single property.

  • Anonymous
    September 03, 2014
    @Jon - Yep that should work now, things that aren't supported in SQL conversion should just evaluate on the client. @Henrik Dahl - Check out this extension for EF6.1 codefirstfunctions.codeplex.com. @Martin - There isn't support in the top level API yet (but there will be), you can drop down to the StateEntry (available from context.ChangeTracker.Entry(myEntity).StateEntry) and use the SetPropertyModified method. You can set the entity state to Unchanged first to get the entity tracked but not modified. Of course, this will all be a lot easier once the top level API is padded out.

  • Anonymous
    September 27, 2014
    Thanks for your nice post.I like it very much.