Friday, April 30, 2010

I wanted to be able to save data to either a database on a SQL Server 2008 or an equivalent database on SQL Server Compact 3.5 with the minimum of hassle. Enter the new features of Entity Framework 4.0. I followed POCO in the Entity Framework: Part 1 - The Experience to turn off code generation.

I added two EDMs to my project, one for each database. I modified the ObjectContext class to accept different contexts, i.e.: