views:

61

answers:

1

Hi,

I am working on a application which I want to expose to external world using ODATA. Let me first give you idea of that application.

In that application I need to create a library that will allow the users to perform CRUD operations on the database. For this client has provided XSD , from which we need to generate the classes. Using these classes and client provided data service provider user can perform the CRUD operations.

This application is ready and now I want to expose it using ODATA. Here are my findings w.r.t. exposing this library as ODATA

  1. I need to either use Custom/ Reflection provider as I cannot use Entity Framework because I do not have access to data.

But In future the XSD will change. So I need to change the metadata whenever this happens. Can I handle it such a way that latest metaddata will always be exposed without changing my code?

Shall I go ahead with reflection / custom provider?

Thanks,

Ram

A: 

You can definitely change the shape of the OData that is returned when the XSD changes. However, there is a serious problem with this. Most clients will generate client classes based on the SSDL that was present when the service reference was added. As a result, clients will fail as the object model will not match the new shape of data.

You are much better off creating a new version of the service when the schema changes. Then, even if you need to remove the previous versions (which will cause a runtime error on the client).

The other option is to use WCF forward compatible features. However, I have no idea how they work with WCF Data Services.

Erick

Erick T