2011-12-07 23 views
2

"StartAction"サービス操作を公開するOdataサービスがあります。 、

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

私は一つだけのアイテムでのIQueryableを返します場合、私はそれを周りに作業することができます:この操作では、私はアクションナビゲーションプロパティを展開$しようとすると、私は次のエラーを取得する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> 

を返します。見た目は醜いです。誰かが、単一のエンティティを返すサービスオペレーションのために$拡張作業を行う方法を他の方法で知っていますか?

ありがとうございます。

P.S.サービスはカスタム実装を持っています

答えて

2

他のクエリオプションが機能するためには、サービス操作でIQueryableを返す必要があります(WCF DSでは追加クエリオプションの式を作成するためにIQueryableが必要です)。 IQueryableを1つの結果で返しても問題ありません。サービス操作メソッドに[SingleResult]属性を追加して、IQueryableが単一の値だけを返すようにWCF DSに通知します(クエリオプションも同様に動作します)。

+0

ありがとうございます!私はすでにそれを実現:) – Konstantin

関連する問題