A while back I blogged about customizing the SQL that is generated by Code First Migrations. In this post I’m going to step back up the pipeline a bit and look at customizing the code that gets scaffolded when you call Add-Migration. When we built Code First Migrations we made an effort to make everything … Continue reading Code First Migrations – Customizing Scaffolded Code
Entity Framework
//build/ 2012 Talk Video and Source Code
This year at the //build/ conference I presented a session titled ‘Building data centric applications for web, desktop and mobile using EF5’. In addition to EF5, I also covered the what and when of EF6 and did a quick demo of my favorite EF6 feature (custom code first conventions). You can view the session recording, … Continue reading //build/ 2012 Talk Video and Source Code
Customizing ‘Reverse Engineer Code First’ in the EF Power Tools
Beta 2 of the Entity Framework Power Tools was recently released. By far the most popular feature out of these power tools is the ability to reverse engineer a Code First model from an existing database. Admittedly ‘Code First’ wasn’t the best choice of names… Code First is really just a code-based alternate to the … Continue reading Customizing ‘Reverse Engineer Code First’ in the EF Power Tools
Dynamically Building a Model with Code First
I’ve answered a few emails recently on this topic so it felt like time to turn it into a blog post. In this scenario the set of classes that make up your model isn’t known at compile time and is discovered dynamically at runtime. An example of such a scenario is a WordPress/Orchard/etc. style website … Continue reading Dynamically Building a Model with Code First
Testing With a Fake DbContext
One of the most popular posts on my blog has been “EF CTP4 Tips & Tricks: Testing With Fake DbContext”. That post was built on a pre-release version of Entity Framework so I thought I’d provide an updated post on top of the DbContext API surface we ended up shipping. In this post we are … Continue reading Testing With a Fake DbContext
Running & Scripting Migrations from Code
Code First Migrations is included as part of Entity Framework starting with the EF 4.3 release. Migrations are normally created and run from the Package Manager Console in Visual Studio. These commands are just thin wrappers over public APIs that you can call directly from your own code. In this post you’ll see how to … Continue reading Running & Scripting Migrations from Code
Customizing Code First Migrations Provider
Code First Migrations is included as part of Entity Framework starting with the EF 4.3 release. One feature we haven’t really blogged about yet is the ability to include additional arguments in a migration operation. These arguments are then made available to the SQL generator. You can then derive from the SQL generators that we … Continue reading Customizing Code First Migrations Provider
Magic Free Code First Migrations
This post is now out of date. Be sure to check out EF 4.3 Beta 1. <transparency>I work for Microsoft</transparency> (just kidding… but I couldn’t leave the tag open) We recently released a very early preview of Code First Migrations and it’s been getting some mixed feedback, the negative feedback falls into three buckets: Stuff … Continue reading Magic Free Code First Migrations
EF 4.1 Multi-Tenant with Code First
After a long break while we got EF 4.1 (Magic Unicorn Edition) polished up and shipped it felt like time to get some content up on here again. We’ve released some good introductory content for EF 4.1 on the MSDN Data Developer Center so I thought I’d dive into something a little more advanced. The … Continue reading EF 4.1 Multi-Tenant with Code First
EF CTP4 Tips & Tricks: Testing With Fake DbContext
This post is based on a pre-release version of Entity Framework. An updated post is available here. This is the sixth in a series of posts about the recently released Entity Framework Feature CTP4, now affectionately known as “EF Magic Unicorn Edition”. In this post we are going to take a look … Continue reading EF CTP4 Tips & Tricks: Testing With Fake DbContext
EF CTP4 Tips & Tricks: Querying Navigations Without Loading
This is the fifth in a series of posts about the recently released Entity Framework Feature CTP4, now affectionately known as “EF Magic Unicorn Edition”. Today we are going to take a look at how to query the contents of the navigation property of a loaded entity without loading the contents of that navigation into … Continue reading EF CTP4 Tips & Tricks: Querying Navigations Without Loading
EF CTP4 Tips & Tricks: Running Additional DDL
This is the fifth in a series of posts about the recently released Entity Framework Feature CTP4, now affectionately known as “EF Magic Unicorn Edition”. For this post I’m going to assume you have a basic knowledge of Code First using DbContext. One common question I hear is “how do I include additional indexes (or … Continue reading EF CTP4 Tips & Tricks: Running Additional DDL
EF CTP4 Tips & Tricks: WCF Data Service on DbContext
This is the fourth in a series of posts about the recently released Entity Framework Feature CTP4, now affectionately known as “EF Magic Unicorn Edition”. For this post I’m going to assume you are somewhat familiar with the Productivity Improvements for EF and WCF Data Services. You can download the completed VS2010 project from this … Continue reading EF CTP4 Tips & Tricks: WCF Data Service on DbContext
EF CTP4 Tips & Tricks: Mapping to an Existing Database
This is the third in a series of posts about the recently released Entity Framework Feature CTP4 (AKA “EF Magic Unicorn Edition”). Most of the samples/demos of Code First so far have focused on creating a new database that is generated from a set of classes, however Code First also can be used in scenarios … Continue reading EF CTP4 Tips & Tricks: Mapping to an Existing Database
EF CTP4 Tips & Tricks: Find
This is the second in a series of posts taking a quick look at the some of the features in the recent Entity Framework Feature CTP4, also recently dubbed “EF Magic Unicorn Edition”. In the last post we looked at Include with lambda and today we are going to look at the new Find method. … Continue reading EF CTP4 Tips & Tricks: Find
EF CTP4 Tips & Tricks: Include with Lambda
The release of Entity Framework Feature CTP4 was recently announced and included some walkthroughs touching on the core functionality included in the CTP. Over the next couple of weeks I’m going to post up a series of short articles that cover some of the finer points in the CTP. The CTP includes some work called … Continue reading EF CTP4 Tips & Tricks: Include with Lambda
Entity Framework (EF) – Events
Introduction In this post we are going to take a look at some of the events that are raised by various parts of the Microsoft ADO.NET Entity Framework (EF). I’m using the recently released Beta 1 of Visual Studio 2010 / .Net Framework 4.0 for this demo but most of the information also applies to … Continue reading Entity Framework (EF) – Events
NTier with Entity Framework (EF) 4 Beta 1 – (VS2010 / .Net 4.0 Beta 1)
Introduction My blog has been feeling very neglected after my move to the US and I thought with the recent release of Visual Studio 2010 / .Net Framework 4.0 Beta 1 it would be a good time to get back into a regular blogging rhythm. So for the first post I thought I’d run through … Continue reading NTier with Entity Framework (EF) 4 Beta 1 – (VS2010 / .Net 4.0 Beta 1)