Friday, March 20, 2009

Using a custom base class for a generated ObjectContext

We're adapting our framework to support the Entity Framework in addition to its current support for Linq to SQL and running into issues. The Linq to SQL approach involved, among other things, a Base Data Context class that we could easily instruct the built in code generator to use. The LINQ to SQL designer has first class support for specifying that we want the generated data context to inherit from our BaseDataContext instead of the built-in DataContext directly.

Not only does the Entity Framework designer not have first class support for this, it appears that the Entity Framework tool chain itself has no support for this at all. I hope I'm wrong about this, but thus far I've been completely unable to find a way to specify that I want my generated ObjectContext to inherit from my BaseObjectContext instead of just ObjectContext.

Not impressed.

No comments: