Highlights of Rowan Miller’s EF6/EF7 Talk at TechEd 2014

Yesterday afternoon, Channel 9 chose to broadcast the Entity Framework session presented by Rowan Miller, a Program Manager on the EF team at Microsoft. Rowan is an excellent presenter and the session was a 400 level, demo-heavy session. And it was awesome!

While the abstract promised an advanced demo-heavy session showing off features of EF6 (including the latest rev, EF6.1), Rowan also showed off some of the new functionality that will be coming in EF7.

Here are some of the highlights of his session.

The first part of the session dug into demos that showed off how you can combine features of EF6 to implement functionality that many developers would like to achieve in their applications.

The demos also used the recently released EF6.1 which has over 120 bug fixes plus a handful of new features. EF 6.1.1 is a patch release that is coming out soon. It is mostly bug fixes and some critical fixes to performance regressions that were introduced with EF 6.0.2.

The first of these was “soft deletes”, in other words for all intents & purposes, when you delete a record it is gone from the application. But it is not removed from the database. Rather than having to mark a record as “don’t show this to me again” and always include filtering in queries, Rowan showed how you can get Entity Framework to take care of these tasks in the background.  He combined the use of

  • Custom Conventions
  • Mapping Data Annotations to Custom Conventions
  • Command interceptors (for queries and change commands)
  • CommandTree Interceptor (in 6.1)

Here’s a slide where he laid out how he would pull off the whole thing:image

 

image

Next,Rowan demonstrated how you can enforce Entity Framework to automatically perform full text searches. This meant that first the database needed to have Full Text search implemented. Rowan used EF6’s Custom Migrations feature (a community contribution to EF6 Smile ) to ensure that EF migrations would change the database to have full text search enabled. Next was to change how EF queries are translated to SQL queries. This was a much trickier bit of code that benefited from the fact that with EF 6.1, the Mappng API was exposed so that we could code against it directly. The team was a little reluctant to expose that API only because it’s older EF code and quite a bit messier to work with than they would like. SO they do plan to clean it up but in the meantime, at least we have access to it. Smile

The final EF6 demo showed how to leverage the support for using Mocking frameworks more easily in EF6. In addition, Rowan has created his own APIs (not an official part of EF) to help even more (mocking DbSets is hard!) so he used his EntityFramework.Testing API in his demo.

image

And then…..EF7 (sneak peek).

So the team has started working on EF7. It is a work in progress and open-source. You can find it at github.com/aspnet/entityframework .

EF will undergo a “sea change” with this version. It is time to shed some of the 8 year old code in the APIs that is making it harder and harder for the team to evolve Entity Framework. EF6 will continue to evolve but for how long and to what degree, it’s hard to say. (My words, not Rowan’s). EF7 will absolutely introduce breaking changes. BUt the most important patterns, e.g., basic DbContext interaction, will remain in tact.

Rowan demo’d two exciting features they are working on in EF7 so far.

The first is the ability to leverage your existing knowledge of EF to interact with NoSQL databases. An important note he made was that EF will not try to whitewash the type of data store that it’s connecting to. There will be functionality that pertains to relational that may not also pertain to NoSQL and vice versa. But basic CRUD operations, change tracking etc will be familiar if you’re already used to how EF works.

The other demo was working on a Windows Phone app where the app was able to persist data on the phone using Entity Framework (to a SQLite database).

This is of course, all *very* early stuff.

Rowan was clearly very exicted to share the EF7 demos, but the EF6 demos were equally impressive.

Plus he is a natural as a presenter. It was a pleasure to watch his presentation.

You can see it yourself here:

The Channel9 page for this session is here: Entity Framework: Building Applications with Entity Framework 6

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

8 thoughts on “Highlights of Rowan Miller’s EF6/EF7 Talk at TechEd 2014

    1. ahh, the format of my blog theme was mucking it up. I just learned how to use the “scale” parameter for embedding a video and its fixed now. Thanks!

  1. Great session. I really like the direction EF is going and I can’t wait for EF7.

    I got a late start with EF because I never liked all the “magic” code, ridiculous defaults, and painful debugging. Glad to see they are addressing all this.

  2. Hi Julie: I’ve been diving into your Pluralsight EF presentations, and enjoying them. I’ve gotten the impression that the Model-First approach is disappearing in EF7, and quite possibly the DB-First as well? What is your impression on this subject, and would it be a waste to learn this approach if I won’t be able to use it after EF6? I am somewhat ignorant on the topic and reasons behind it, but it seems like a step backwards to me. I can’t imagine hand coding all those classes. What do you think?

    1. Ef6 will stick around alongside of EF7. It’s good to be aware of the designer workflow in case you might ever find it useful. But if code only works for you, I’d just focus on that. There are some other options. If you have an existing database, there are tools (in Visual Studio and third part) that will let you reverse engineer classes and models from an existing database. If starting from scratch, I’m not sure if designing in a designer is more efficient than just hand coding — especially given that hand coding gives you a lot more flexibility than designer plus code generation. However there are a lot of other ways to generate code if you don’t want to hand code classes . Those aren’t specific to EF though. HTH

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.