In-Memory Run-Time Code Generation With .NET – Part 4

This article is split into 5 posts.

  1. Introduction
  2. Templating Engines
  3. Code Generation From Source
  4. Code Generation From Model
  5. Loading

Read More »

EF5 Migrations: Multiple Data Contexts in a Single Database

Consider this: an application is built up from multiple modules, each with a different set of entities and data contexts. All modules’ data entities should be saved in a single database and the contexts should support automatic migration.

Sounds like a reasonable requirement, right? We’ll, you can’t do that with EF. Not with EF5 nor with EF6 (as far as I can tell from the current alpha version). The problem is this: The data context stores it’s models and mappings in the history table. Upon model modification checking, the current types and properties in the the data context are compared to the last version of the conceptual model in the history table. All modifications to the database result from this comparison.
Read More »