Entity Framework Magic Unicorn (and much more!) is now open source with take backs
Almost exactly two years from the day we announced Entity Framework "Magic Unicorn Edition" and just a few months after open sourcing of ASP.NET MVC 4, ASP.NET Web API, and Razor we're happy to announce we will release the source code for the Entity Framework under an open source license as well!
This is cool for a number of reasons. The EF team is continuing to move forward with a commitment to transparency. The community will be able to not only watch the check-ins and monitor the progress of the project, but also get involved themselves, submit pull requests for bug fixes, use daily builds and give feedback much more efficiently.
Just like the open source ASP.NET components and open source Azure SDKs, Entity Framework will continue to have the same full-time Microsoft engineers working on the project and will remain a fully supported Microsoft product that will ship both standalone AND with Visual Studio.
The code being open sourced includes the Entity Framework Runtime and NuGet packages, Code First, the DbContext API, the Entity Framework Power Tools as well as pieces that shipped originally with the .NET Framework. The team is also working to open source the EF Designer surface in the future as well.
By open sourcing EF we open up the design and development process that started the EF 4.1 preview builds. People who are interested can get nightly builds, see the source code changes, and engage in discussion about the design and implementation. The EF team is committed to opening up the development and involving the community and are going to work hard to make that happen.
Entity Framework will live in a Git repository at http://entityframework.codeplex.com and you're welcome to follow, fork, discuss and file bugs against it as you see fit. You could fork it just to fix a bug quickly to unblock work that uses EF, or you could create a custom version of EF with different capabilities. Since the changes can also be contributed back this gives people a lot greater flexibility in how they develop with EF.
Again, we've previously open sourced the Azure SDKs, the ASP.NET Web Stack, and now Entity Framework. These products all have the same teams assigned (and in most cases have more resources than before), the same developers coding and the same support guarantees. They are open source projects but they are also supported and released Microsoft products suitable for use in any company. They'll continue to ship with Visual Studio as well as standalone as packages in NuGet. The investment in all these technologies has been significant in the past year and investments will continue going forward with new versions and even more cool features.
Async - My Favorite New Entity Framework feature
Just as an example, I wanted to show a new feature in the upcoming EF6 that the team is hard at work on for release next year. Visual Studio 2012 introduces the Aync and Await concepts that make asynchronous code much easier to write (and understand). Damian, Levi and I talked about async and the surrounding concepts in this week's Hanselminutes podcast.
EF6 will introduce support for the new task-based asynchronous pattern when querying and saving data. You can actually look in the open source code base today and find the first parts of this feature are already checked in! ;)
As an example, using EF5 you could define a helper method that will find the store closest to a given location. Any code that calls this method would need to wait while it executed.
public Store FindClosestStore(DbGeography location)
{
using (var context = new StoreContext())
{
return (from s in context.Stores
orderby s.Location.Distance(location)
select s).First();
}
}
But in EF6 it is easy to turn this into an asynchronous method that can be left to execute while the calling code continues on with other tasks.
public async Task<Store> FindClosestStore(DbGeography location)
{
using (var context = new StoreContext())
{
return await (from s in context.Stores
orderby s.Location.Distance(location)
select s).FirstAsync();
}
}
This is just one feature but it's my favorite. You'll also soon see mapping of Stored Procedures as well as support for custom conventions using the Code First API.
Be sure to follow the Entity Framework Repository and subscribe to the check-ins via RSS to stay up on the latest features and improvements to EF! Also, do go chat directly with the Entity Framework team on Jabbr (powered by SignalR and Azure) in their room: http://jabbr.net/#/rooms/EntityFramework
Related Links
Sponsor: My personal thanks to DevExpress for sponsoring this week's feed! Check out their new stuff, it's amazing! DXperience 12.1 helps you realize your creative vision. Beautiful design and rich user experiences are at the center of the modern development conversation. From iPads to mobile phones, focus on great design. Try Now.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Scott, I know you played a big part in this, well done sir!
:(
Although it is available on codeplex you can easily put it on github if that works for you.
I just create a repository and added an additional remote and push the repository to it : https://github.com/ramonsmits/entityframework
That's only interesting if you think git==github, which is false. Codeplex is the main place where Microsoft puts source from the .NET runtime. GitHub is where some related projects get hosted, especially if the project is farther away from core .NET (like Azure stuff for Node.js).
Anonymous - No chance. We released the Azure SDKs, MVC, Razor, WebAPI, and they have more developers than ever. Same with EF. Open Source is the way we're going.
http://www.hanselman.com/blog/EntityFrameworkCodeFirstMigrationsAlphaNuGetPackageOfTheWeek10.aspx
(where I can't comment because it's too old) Says:
What Changes Can Migrations Detect Automatically?
Renaming a property or class
See ‘Renaming Properties & Classes’ for the additional steps required here
"Renaming Properties & Classes" is not mentioned anywhere else in that post. Nor your blog. Nor the ADO.Net blog. In fact, a google search for that string finds exactly one hit: That blog post, with no further explanation.
How does Migrations handle renaming properties automatically? From what I can tell it does not; it just drops columns and adds columns, losing data in renamed columns without manual intervention. Is there a way to get the above described feature to work?
Comments are closed.