如何使我的FunctionImport显示在默认响应中?

时间:2019-03-19 18:39:54

标签: asp.net-core odata

如果您访问https://services.odata.org/v4/TripPinService/的WCF变体,则会在默认情况下看到以下内容:

  

{“ @ odata.context”:“ http://services.odata.org/V4/TripPinService/ $ metadata”,“ value”:[{“ name”:“ Photos”,“ kind”:“ EntitySet”,“ url”:“ Photos” },{“ name”:“ People”,“ kind”:“ EntitySet”,“ url”:“ People”},{“ name”:“ Airlines”,“ kind”:“ EntitySet”,“ url”:“ Airlines“},{” name“:” Airports“,” kind“:” EntitySet“,” url“:” Airports“},{” name“:” Me“,” kind“:” Singleton“,” url“ :“我”}, {“名称”:“ GetNearestAirport”,“种类”:“ FunctionImport”,“ url”:“ GetNearestAirport”} ]}

GetNearestAirPort函数位于默认文档中。但是,让我们使用Restier / Asp.net Core检查TripPin的变体(无关紧要您得到相同的结果):

https://services.odata.org/TripPinRESTierService/(S(af0krox2afpn2hg1aqguvtky))/

产生以下JSON:

  

{“ @ odata.context”:“ https://services.odata.org/TripPinRESTierService/(S(nwv34zfilzg324maurtzibqw))/ $ metadata”,“ value”:[{“ name”:“ People”,“ kind”:“ EntitySet”,“ url”:“ People” },{“ name”:“航空公司”,“种类”:“ EntitySet”,“ url”:“航空公司”},{“ name”:“机场”,“种类”:“ EntitySet”,“ url”:“机场“},{”名称“:” NewComePeople“,”种类“:” EntitySet“,” url“:” NewComePeople“},{”名称“:” Me“,”种类“:” Singleton“,” url“ :“我”}]}

注意,函数导入已消失。如何获得要显示的功能。两种情况下都设置了服务文档中的标志显示,但似乎不是驱动程序。

0 个答案:

没有答案
相关问题