C# WCF-OData:如何访问操作

C# WCF-OData:如何访问操作,c#,wcf,client,odata,C#,Wcf,Client,Odata,我正在使用VisualStudio中由“添加服务引用”派生的System.Data.Services.Client.DataServiceContext的子类通过OData服务访问数据。服务的$metadata.xml中的定义包括: ... ... 如何通过DataServiceDeviceContext访问定义的函数LandParcelByRegistrationYear,提交参数registrationYear的值并使用结果 我已经导入了$metadata.xml,但找不到给定操作名称的

我正在使用VisualStudio中由“添加服务引用”派生的
System.Data.Services.Client.DataServiceContext
的子类通过OData服务访问数据。服务的
$metadata.xml
中的定义包括:


...
...
如何通过
DataServiceDeviceContext
访问定义的函数
LandParcelByRegistrationYear
,提交参数
registrationYear
的值并使用结果

我已经导入了
$metadata.xml
,但找不到给定操作名称的方法

<schema Namespace="dotNetBF.OData" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
    <EntityContainer Name="OData" m:IsDefaultEntityContainer="true">
        <EntitySet Name="SewageArea" EntityType="GeoMan.SealingRegister.SewageArea" />
        <EntitySet Name="LandParcel" EntityType="GeoMan.SealingRegister.LandParcel" />
        ...
        <AssociationSet Name="GeoMan_SealingRegister_SewageArea_LandParcel_GeoMan_SealingRegister_LandParcel_LandParcelPartnerSet" Association="GeoMan.SealingRegister.GeoMan_SealingRegister_SewageArea_LandParcel_GeoMan_SealingRegister_LandParcel_LandParcelPartner">
            <End Role="LandParcelPartner" EntitySet="SewageArea" />
            <End Role="LandParcel" EntitySet="LandParcel" />
        </AssociationSet>
        ...
        <FunctionImport Name="LandParcelByRegistrationYear" EntitySet="LandParcel" ReturnType="Collection(GeoMan.SealingRegister.LandParcel)">
            <Parameter Name="registrationYear" Mode="In" Type="Edm.String" />
        </FunctionImport>
    </EntityContainer>
</Schema>