2

I am currently busy creating a .NET 6.0 application that uses the MS Graph Beta API to collect a bunch of active TI's from the Security.TiIndicators endpoint. However something seems to be wrong.

In the documentation it is stated to use the following code:

GraphServiceClient graphClient = new GraphServiceClient( authProvider );

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

However, when I try to implement this I get the following error:

'TiIndicatorsRequestBuilder' does not contain a definition for 'Request' and no accessible extension method 'Request' accepting a first argument of type 'TiIndicatorsRequestBuilder' could be found (are you missing a using directive or an assembly reference?)

I have the following MS Graph packages installed:

  • Microsoft.Graph.Auth | 1.0.0-preview.7
  • Microsoft.Graph.Beta | 5.13.0-preview
  • Microsoft.Graph.Core | 3.0.0-preview.16

PS. I have more packages but they are not related to MS Graph.

Rubeste
  • 75
  • 1
  • 8

1 Answers1

3

For beta SDK you can call directly method GetAsync() which returns TiIndicatorCollectionResponse.

Collection of TiIndicator is accessible through Value property.

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

Since Microsoft.Graph.Beta | 5.12.0-preview, there is a new way how beta models and request builders are generated but it's not yet documented.

user2250152
  • 14,658
  • 4
  • 33
  • 57
  • Any idea where it is documented. Cause I also want to use query paramaters. – Rubeste Oct 24 '22 at 13:07
  • 3
    Found it: [Link](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/feature/5.0/docs/upgrade-to-v5.md#query-options) – Rubeste Oct 24 '22 at 13:20
  • 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 Apr 11 '23 at 08:54