2016-08-30 5 views
0

Microsoft.Azure.ActiveDirectory.GraphClient.ActiveDirectoryClient APIの使用目的のIdentifierUrlと同じAAD内の既存のアプリケーションを検索しようとしています。これは私が1つを作成するか、既存のものだけを残すかを決めることができるようにするためです。 次の呼び出しを使用しています。しかし、私はこのエラーが発生します:コレクションプロパティ 'identifierUris'を 'where'クエリ式で使用することはできません

The collection property 'identifierUris' cannot be used in a 'where' query expression. Collection properties are only supported as the source of 'any' or 'all' methods in a 'where' query option 

この方法をお勧めしますか?

var result = await client.Applications.Where(a => a.IdentifierUris.Any(i => i == identifierUri)).ExecuteAsync(); 

次のように要求に変換されますよ:ここAzureのADグラフ用フィルター上

https://graph.microsoft.com/beta/applications?$filter=identifierUris/any(c:c eq 'yourIdentifierUri') 

詳細情報をありがとう

public static async Task<IApplication> FindApplicationByUrlAsync(string accessToken, string tenantId, string identifierUrl) 
    { 
     var graphClient = NewActiveDirectoryClient(accessToken, tenantId); 
     var matches = await graphClient.Applications.Where(app => app.IdentifierUris.Contains(identifierUrl)).ExecuteAsync(); 
     return matches.CurrentPage.ToList().FirstOrDefault(); 
    } 

答えて

関連する問題