2

先日、Azure Function を .net5 に移行しましたが、現在、基本的な入力バインディングに苦労しています。

私のクエリ => /api/query?sgtins=foo1&sgtins=foo2

バージョン 3.1 では、単純な req.Query["sgtins"] で十分です。しかし、現在.net5ではわかりません。文字列、int などを使用しても問題ありませんが、IEnumerable を使用するとすぐに実行時にクラッシュします。何か案は?.net5に関するドキュメントは、現時点では哀れです:(

これは私のデモコードです。上記のようにURLを使用します。

ここに画像の説明を入力

これは例外です。

[2021-06-14T08:34:53.015Z] 'Functions.QueryProductEntities' を実行しました (失敗、Id=5f33b8ab-fdb2-483c-93fc-6dac3bb25ddc、期間=531ms) [2021-06-14T08:34:53.015Z] システム.Private.CoreLib: 関数の実行中に例外が発生しました: Functions.QueryProductEntities。System.Private.CoreLib: 結果: 失敗 [2021-06-14T08:34:53.015Z] 例外: Microsoft.Azure.Functions.Worker.Diagnostics.Exceptions.FunctionInputConverterException: 関数 'QueryProductEntities' の 1 つの入力パラメーターの変換中にエラーが発生しました: 変換できませんタイプ「System.Collections.Generic.IEnumerable`1[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]」への入力パラメータ「sgtins」弦'。[2021-06-14T08:34:53.015Z] Microsoft.Azure.Functions.Worker.Context.Features で。

4

1 に答える 1