1

私のアクションパラメータの1つは、[FromUri]属性を持つparam1、param2、param3パラメータを持つクラスのインスタンスですそれを[FromBody]に置き換えてください)
また、そのパラメータもルーティング中です。ルーティングとアクションから自動的に生成されるasp.net web apiヘルプページのパラメータを無視する方法

asp.net web apiのヘルプページは、アクションからパラメータを生成するとき、私はそれらをURIパラメータで取得しています。
どうすればそれらを無視できますか?

+1

を使用しない場合、これはあなたのヘルプページからあまりにも多くのパラメータを削除する場合がありますか? – Botonomous

+0

他のケースがうまくいきません...私はそれが属性または設定になると思うが、ブログの研究と投稿は役に立たない – Aren

答えて

0

Areas\HelpPage\HelpPageConfigurationExtensions.csで、方法GenerateUriParametersを見つけ、else節をコメントアウトします。

else 
{ 
    Debug.Assert(parameterDescriptor == null); 

    // If parameterDescriptor is null, this is an undeclared route parameter which only occurs 
    // when source is FromUri. Ignored in request model and among resource parameters but listed 
    // as a simple string here. 
    ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string)); 
    AddParameterDescription(apiModel, apiParameter, modelDescription); 
} 

あなたは一貫してあなただけの署名から削除[FromUri]

関連する問題