使用webservice作为ado.net实体数据模型的数据源

时间:2021-04-12 02:09:43

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

我目前正在尝试使用web服务作为ado.net edm的源代码。例如:http://data.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?

我已将web服务的xml存储在变量中,以便我可以在必要时使用它。有没有办法将webservice的数据与datamodel相关联,以便动态创建edm的表与webservice相关?

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

我只需要使用行名称和类型动态创建表。

Best Regards Julian

最好的问候朱利安

1 个解决方案

#1


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.

您可以使用WCF数据服务客户端实用程序(DataSvcUtil.exe)。这是一个命令行实用程序,允许您创建从其元数据中使用任何OData服务所需的.Net类。

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.

您将需要执行Visual Studio命令提示符并确保Visual Studio安装包含WCF功能:使用DataSvcUtil.exe,您将需要一个类似于此的条目。

datasvcutil /out:NetflixODataProxy.cs /uri:http://odata.netflix.com/v2/Catalog/ /language:CSharp /nologo /version:2.0

#1


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.

您可以使用WCF数据服务客户端实用程序(DataSvcUtil.exe)。这是一个命令行实用程序,允许您创建从其元数据中使用任何OData服务所需的.Net类。

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.

您将需要执行Visual Studio命令提示符并确保Visual Studio安装包含WCF功能:使用DataSvcUtil.exe,您将需要一个类似于此的条目。

datasvcutil /out:NetflixODataProxy.cs /uri:http://odata.netflix.com/v2/Catalog/ /language:CSharp /nologo /version:2.0