小编use*_*646的帖子

ODATA WebService,获取$元数据 C#

我有一个 WebService 公开了这个$metadata

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">     > <edmx:DataServices m:DataServiceVersion="1.0"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<Schema xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://schemas.microsoft.com/ado/2007/05/edm"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
Namespace="NAV"> 
<EntityType Name="PAsset"> 
<Key> <PropertyRef Name="No"/> </Key>  <Property Name="No" Nullable="false" Type="Edm.String"/>  <Property Name="Description"
Nullable="true" Type="Edm.String"/>  <Property Name="Inactive"
Nullable="false" Type="Edm.Boolean"/>  <Property Name="Insured"
Nullable="false" Type="Edm.Boolean"/> </EntityType> 

<EntityType Name="PAssetsDepreciationBook">

<EntityType Name="PBankAPostGrp">
<EntityType Name="PCompany">
<EntityType Name="PCustomer">
Run Code Online (Sandbox Code Playgroud)

$metadata是否可以在 C# 应用程序中获取其中的信息?

我有一个应用程序,其中引用了正在运行的服务,以及我正在使用的一些代码:

uriString = String.Format("PAssetsDepreciationBook?$filter=FA_No eq '{0}'",cliente);

contex = new ServiceReference1.NAV(new Uri(serviceEndPoint)); contex.Credentials = CredentialCache.DefaultCredentials;

var 客户 = contex.Execute(new Uri(uriString, UriKind.Relative));

foreach (var c incustomers) …

c# metadata odata

2
推荐指数
1
解决办法
6088
查看次数

标签 统计

c# ×1

metadata ×1

odata ×1