Sounds daft i know but i want to do something a bit out of the ordinary …
essentially I’m looking to build solution that has a wcf data service at the back end (or something of that ilk at least) that allows me to query my database using simple url syntax.
the problem i have is that when my db schema changes i have to recomile the entire back end and that’s not good because the solution i’m building allows the definition of “entities” so to speak.
Essentially what i want to do is have the model update every time the db updates … as a sort of triggered event.
I’m thinking that EF won’t do this which leads me to my actual question …
How would you solve this problem?
I need exactly what a wcf data service offers out of the box … just with a more dynamic data model beneath it.
You need to change the O/RM to something more dynamic … something like Massive could be used instead of EF.
Someone looks to be doing similar with WebWCF … Massive with WCF Web Api to return dynamic types/Expandos?.
If you use data services then you’d need to figure out some way to represent the Massive as a ‘DataContext’. WebWCF on the other hand would serialise dynamic objects as a lump of JSON or XML where required.
The problem with your proposed approach is one where the Web Service contract is dynamic and not versioned. This means that if you delete/rename/change a field you essentially have created a change to the ‘Contract’ that the clients use to consume the web service. This can lead to a client breaking unless updated at the same time.
If you are looking at a low friction way of managing model change updating database I have found that EF Code First 4.2 and EF Migrations works pretty well for me. 0.7.0.1 is reasonably stable and all available from NuGet.