Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf Can';t根据服务操作结果调用$expand_Wcf_Odata - Fatal编程技术网

Wcf Can';t根据服务操作结果调用$expand

Wcf Can';t根据服务操作结果调用$expand,wcf,odata,Wcf,Odata,我有公开“StartAction”服务操作的Odata服务。此操作返回ActionResponse实体 <EntityType Name="ActionResponse"> <Key> <PropertyRef Name="FolderId" /> </Key> <Property Name="FolderId" Type="Edm.String" Nullable="false" />

我有公开“StartAction”服务操作的Odata服务。此操作返回ActionResponse实体

  <EntityType Name="ActionResponse">
    <Key>
      <PropertyRef Name="FolderId" />
    </Key>
    <Property Name="FolderId" Type="Edm.String" Nullable="false" />
    <Property Name="ClientData" Type="Edm.String" Nullable="true" />
    <Property Name="ProcessCaption" Type="Edm.String" Nullable="true" />
    <Property Name="ProcessName" Type="Edm.String" Nullable="true" />
    <Property Name="ProjectName" Type="Edm.String" Nullable="true" />
    <Property Name="ProjectVersion" Type="Edm.Int32" Nullable="false" />
    <Property Name="ServerData" Type="Edm.String" Nullable="true" />
    <Property Name="StageName" Type="Edm.String" Nullable="true" />
    <Property Name="UserName" Type="Edm.String" Nullable="true" />
    <NavigationProperty Name="Action" Relationship="Metastorm.EngineData.ActionResponse_Action_Action_ActionResponse" FromRole="ActionResponse_Action" ToRole="Action_ActionResponse" />
  </EntityType>
 <Association Name="ActionResponse_Action_Action_ActionResponse">
    <End Role="ActionResponse_Action" Type="Metastorm.EngineData.ActionResponse" Multiplicity="0..1" />
    <End Role="Action_ActionResponse" Type="Metastorm.EngineData.Action" Multiplicity="0..1" />
  </Association>
我可以解决它,如果我将返回IQueryable只有一个项目,但它看起来很丑。有人知道如何让$expand为返回单个实体的服务操作工作吗

提前谢谢


另外,服务具有自定义实现

服务操作必须返回IQueryable才能使任何其他查询选项工作(这是必要的,因为WCF DS需要IQueryable为其他查询选项构造表达式)。 返回包含单个结果的IQueryable是完全正确的。在服务操作方法上添加[SingleResult]属性,让WCF DS知道IQueryable只返回一个值(以便查询选项相应地运行)

    Query options $expand, $filter, $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource