2
リクエストされたURLから「ステータス」キーと「すべて」キーの値を取得しようとしていますが、クラスオブジェクトをビルドする方法がわかりません。dotnet core webapi json-api準拠クエリーストリング
私が参照してるJSONのAPI仕様は、ここで見つけることができます: http://jsonapi.org/recommendations/#filtering
// requested url
/api/endpoint?filter[status]=all
// my attempt at model binding
public class FilterParams
{
public Dictionary<string, string> Filter { get; set; }
}
[HttpGet]
public string Get([FromUri] FilterParams filter)
{
// never gets populated...
var filterStatus = filter.Filter["status"];
}
いいえ、私はありますJSON API標準に準拠しようとしている:http://jsonapi.org/recommendations/#filtering –
@CarlSagan代替ソリューションを追加しましたモデルバインダーを使用します。 –