0
votes

We use Entity Framework in our product but the database is installed alongside the software for each of our clients. To expose this data I have built a "publish/subscribe-ish" model WCF web service that uses shared sessions to allow the desktop client to notify the service it is available and ready to distribute data. At which point the thinner clients such as mobile apps or web applications can request the data using a unique id / password combination to identify the desktop client (and ultimately its database) it wants data from.

As it stands the web service is very rigid as I'm sure you can imagine; having taken the traditional service operation for each required data set approach.

I would like to replace the current web service with an OData Service for obvious reasons however because the databases are outside the local network of the web service the straight forward WCF DS + EF isn't going to work.

Using ODataLib or WCF Data Services would it be possible to create a data service that merely forwards the request uri and allows a desktop client to parse the query into something Entity Framework understands? If so how would I handle the OData query to EF/SQL on the desktop client side of things. The functionality that does this seems to be deep within the API and tucked away within WCF Data Services (not even sure it exists in ODataLib)

Any help?

1

1 Answers

0
votes

This is not a direct answer to your question. I'm actually a bit confused by what you want the desktop client to do with the OData request. But I'll throw this out as something that might give you further ideas. If you already have a full, thick desktop application that includes a client-side install of a database, then consider this. If the desktop app were a Lightswitch app talking to a local database, all on the client, then behind the scenes Lightswitch wires up an OData service that serves as the pipeline between the client presentation layer and the database. And this OData service is directly accessible (if 'EnableClientAccess' is set to true). In other words, the client desktop app talks to an OData service which talks to the database using EF if you so choose, and gives the user the full visual experience, translating user actions into OData requests. The same OData endpoint, as a standalone service, would talk to the same database and expose the same data functionality as the client, and so, by default, the OData requests are also translated into the same EF actions.