Search code examples
c#wcfentity-frameworkwcf-data-services

WCF DataServices and dynamically changing datasets


from what i've seen so far WCF Data Services are pretty easy to setup when using then in combination with EF.

That's kinda what i'm after out of the box but I also need the ability for the EF model to change at runtime.

I'm building an app where the app users will be able to specify the database structure and then begin populating it ... the relevant UI components needed are then generated with MVC using some clever rule based trickery.

So for example the user will be given a "Create new Object" button, which will let them specify field names.

Once that part is complete the user submits that and it generates a new table in the db. From there the UI components are generated that allow that table to be managed within the app.

The problem of course is getting that new table in to the EF model without a recompile of the back end data service.

The concept being that this builds the database and the pages required to manage the various parts of it (there's a bigger picture in mind here but i don't want to confuse matters by trying to explain it all).

I'm thinking that maybe EF is not the right tool to use at the moment .. because it needs a strongly typed set of entities in order to work ... that may not be possible in this case.

I'm toying with the idea of passing this service Dynamic objects ... (e.g. objects of type Something : dynamic )


Solution

  • OMG ...

    Apparently this is supported (mostly) out the box with EF 4.2

    http://blogs.msdn.com/b/adonet/archive/2011/09/28/ef-4-2-release-candidate-available.aspx

    WOW !!!