Start Debugging
2023-06-13 更新日 2023-11-05 microsoft-graph Edit on GitHub

The type or namespace name 'QueryOption' could not be found

Microsoft Graph .NET SDK 5.0 から、QueryOption クラスは使用されなくなりました。代わりにクエリオプションは requestConfiguration 修飾子で設定します。どうしても QueryOptions を使う必要がある場合は、Microsoft Graph パッケージを 4.x にダウングレードするしかありません。

Microsoft Graph .NET SDK 5.0 から、QueryOption クラスは使用されなくなりました。代わりに、クエリオプションは requestConfiguration 修飾子で設定します。

簡単な例を見てみましょう。

var groups = await graphServiceClient
    .Groups
    .GetAsync(requestConfiguration =>
    {
        requestConfiguration.QueryParameters.Select = new string[] { "id", "createdDateTime","displayName"};
        requestConfiguration.QueryParameters.Expand = new string[] { "members" };
        requestConfiguration.QueryParameters.Filter = "startswith(displayName%2C+'J')";
    });

どうしても QueryOptions を使う必要がある場合、唯一の選択肢は Microsoft Graph パッケージを 4.x のバージョンにダウングレードすることです。

Comments

Sign in with GitHub to comment. Reactions and replies thread back to the comments repo.

< 戻る