I'm working with a database schema that our company has used for years, and am not in a position to change the fundamental structure of it. The need for an API to access this data came up, so we decided to go with WCF Data Services and the Entity Framework. In order to have a data model that made more sense than our table structure, we have our EF models attached to SQL Views instead of tables. This has worked really well for our purposes.
Now I'm in a situation where I'm considering creating a second (updated) version of our API, while needing the existing API to continue to work for old applications, and having the two APIs running side-by-side, accessed via different URL endpoints.
I've created a new WCF Data Service endpoint for the new version, new SQL views as necessary (the names of which have "_v2" appended to them), and a new DB Context that maps the models to the new views. This also works well.
The hiccup is that I'd like to also have separate versions of the EF model classes, as I'd like implement slight differences into them. But I run into the naming conflict, where the EF framework gives the error "mapping of CLR type to EDM type is ambiguous."
The only way to have a second set of EF models with the same names is by having the models be loaded from a separate assembly. Is that my only option here? Is there some other approach I should consider?
I've also considered using the same EF model classes for both versions, and using the Ignore method when configuring the models, but this also doesn't feel ideal.
Any suggestions on alternative approaches appreciated!