5

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

Mario S
  • 11,715
  • 24
  • 39
  • 47
  • I am not entirely sure what you want to do, but if all you want to do is query an OData service, I'd recommend you try [LINQPad](https://www.linqpad.net), it supposedly adds an OData-Service as a DataContext to your solution in just a few clicks. – Manuel Schweigert Oct 22 '12 at 08:49
  • http://www.yoursearchbuddy.com/xml-datasource | http://msdn.microsoft.com/en-us/library/ekw4dh3f%28v=vs.71%29.aspx – MethodMan Jan 18 '13 at 13:35

1 Answers1

1

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
Elliot Wood
  • 964
  • 1
  • 9
  • 29