Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正在尝试将筛选参数与C#PowerBI V2 API GetGroupsAsync()一起使用_C#_Powerbi_Powerbi Embedded - Fatal编程技术网

正在尝试将筛选参数与C#PowerBI V2 API GetGroupsAsync()一起使用

正在尝试将筛选参数与C#PowerBI V2 API GetGroupsAsync()一起使用,c#,powerbi,powerbi-embedded,C#,Powerbi,Powerbi Embedded,我正在尝试使用$filter参数和GetGroupsAsync() 目前,我正在使用MicrosoftPowerBIVersion2API和C# 这就是我尝试使用的方法: public static System.Threading.Tasks.Task<Microsoft.PowerBI.Api.V2.Models.ODataResponseListGroup> GetGroupsAsync (this Microsoft.PowerBI.Api.V2.IGroups operat

我正在尝试使用$filter参数和GetGroupsAsync()

目前,我正在使用MicrosoftPowerBIVersion2API和C#

这就是我尝试使用的方法:

public static System.Threading.Tasks.Task<Microsoft.PowerBI.Api.V2.Models.ODataResponseListGroup> GetGroupsAsync (this Microsoft.PowerBI.Api.V2.IGroups operations, string filter = null, Nullable<int> top = null, Nullable<int> skip = null, System.Threading.CancellationToken cancellationToken = null);
但是,这个$filter参数需要如何格式化才能只检索一个

我找到了一些PowerBIAPI版本:v1.0REST文档

我只需要匹配$filter中的组Id GUID,我尝试了下面的行,但没有成功

var groups = await client.Groups.GetGroupsAsync($"id eq '{workspaceId.ToString()}'");
有没有人能够在PowerBIVersion2API和C#中使用$filter参数


如果GetGroupsAsync()$filter参数可用,我不想在C#中检索所有组并进行筛选。

我尝试运行了您的示例,效果很好。我使用了最新的PowerBI.Api SDK。 您可以使用Fiddler查看正在发送的请求

var groups = await client.Groups.GetGroupsAsync($"id eq '{workspaceId.ToString()}'");