RequestBuilder没有包含"Request"的定义。

3
我目前忙于创建一个使用MS Graph Beta API收集一堆活跃TI的.NET 6.0应用程序,这些TI来自Security.TiIndicators端点。但是似乎出了些问题。
在文档中指出要使用以下代码:(链接)
GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var tiIndicators = await graphClient.Security.TiIndicators
    .Request()
    .GetAsync();

然而,当我尝试实现时,出现了以下错误:
'TiIndicatorsRequestBuilder'不包含'Request'的定义,并且没有可访问的扩展方法' Request '接受类型为'TiIndicatorsRequestBuilder'的第一个参数(是否缺少使用指令或程序集引用?)
我已经安装了以下MS Graph软件包:
- Microsoft.Graph.Auth | 1.0.0-preview.7 - Microsoft.Graph.Beta | 5.13.0-preview - Microsoft.Graph.Core | 3.0.0-preview.16
PS. 我有更多的软件包,但它们与MS Graph无关。
1个回答

3

对于beta版本的SDK,您可以直接调用GetAsync()方法,该方法将返回TiIndicatorCollectionResponse

TiIndicator集合可通过Value属性访问。

var tiIndicatorsResponse = await graphClient.Security.TiIndicators.GetAsync();
var tiIndicators = tiIndicatorsResponse.Value;

自从 Microsoft.Graph.Beta | 5.12.0-preview 版本以来,新的beta模型和请求生成方式已经出现,但目前还没有文档进行说明。

有没有想过它在哪里有记录?因为我也想使用查询参数。 - Rubeste
3
找到了:链接 - Rubeste
1
https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/feature/5.0/docs/upgrade-to-v5.md#removal-of-request-from-the-fluent-api - adumred

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接