【发布时间】:2013-06-07 07:19:42
【问题描述】:
我正在使用 Microsoft WebAPI OData nightly 支持 $expand 和微风 1.3.5 来查询数据
当我使用微风查询实体时: 通过微风.EntityQuery.from("Incidents").where("IncidentID", "eq", 1).expand("IncidentComments");
网络上的调用是 GET /odata/Incidents?$filter=IncidentID%20eq%201&$expand=IncidentComments
从服务器正确返回了带有 IncidentComments 集合的结果,但是当我查看从查询中重新调整的实体时,我得到了正确的实体,但没有 NavigtaionProperty (IncidentComments),当我查看事件实体上的 metadataStore 时,我在元数据中看不到任何 nvigationProperties 只有 dataProperties
当我查看从服务器返回的 odata 元数据 ($metadata) 时,我可以看到导航属性在那里:
<EntityType Name="Incident">
<Key>
<PropertyRef Name="IncidentID" />
</Key>
<Property Name="IncidentID" Type="Edm.Int32" Nullable="false" />
<Property Name="IncidentType" Type="Edm.Int32" Nullable="false" />
<Property Name="Name" Type="Edm.String" />
<NavigationProperty Name="IncidentComments" Relationship="Stabilis.Situator.OpServerTypes.Stabilis_Situator_OpServerTypes_Incident_IncidentComments_Stabilis_Situator_OpServerTypes_IncidentComment_IncidentCommentsPartner" ToRole="IncidentComments" FromRole="IncidentCommentsPartner" />
webapi 返回的元数据有问题吗?
【问题讨论】:
标签: asp.net-web-api odata breeze