Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a webservice as datasource for an ado.net entity data model

i am currently trying to use a webservice as the source for an ado.net edm. For example: http://odata.netflix.com/v2/Catalog/$metadata

I have the xml of the webservice already stored in a variable, so that i can use it, if necessary. Is there any way to relate the data of the webservice to the datamodel, so that the tables of the edm are dynamicly created in relation to the webservice?

I just need to create the tables dynamicly with the row names and types.

Best Regards Julian

like image 684
Julian Breuksch Avatar asked Nov 13 '22 19:11

Julian Breuksch


1 Answers

You can use the WCF Data Service Client Utility (DataSvcUtil.exe). This is a command-line utility that allow you to create .Net classes required to consume any OData service from its metadata.

You will need to execute the Visual Studio Command Prompt and make sure that your Visual Studio installation contains the WCF features: Using DataSvcUtil.exe, you will need an entry similar to this.

datasvcutil /out:NetflixODataProxy.cs /uri:http://odata.netflix.com/v2/Catalog/ /language:CSharp /nologo /version:2.0
like image 116
Elliot Wood Avatar answered Nov 15 '22 08:11

Elliot Wood