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
Visual Studio
What tables are in my EF model? And my Database?
Today I was writing some code that needed to know what tables are present in an EF model… and I realized I’ve written this code multiple times and never remember all the little nuances of it… just in case you ever need to do the same I thought I’d turn it into a blog post … Continue reading What tables are in my EF model? And my Database?
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 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
Invalid value for ‘OSVersion’
If you have a Visual Studio Solution that is failing to build with the error message Invalid value for 'OSVersion' the simplest way to fix this is to set an explicit value for OSVersion in your project file; Navigate to your projects folder in the file system Locate the project file (.csproj for C# .vbproj for … Continue reading Invalid value for ‘OSVersion’