I am trying to replace Azure.Search to Azure.Search.Document.
Here i am finding a issue in the GetIndexesAsync Method , where this method requires a cancellation token.
I just want how this need to be implemented so that we can get that token and proceed further.
Please help.
I tried implementing the Cancellation token but it didn’t work for me .
need help to understand its exact way to implement.
2
Answers
I tried a sample C# console code with Azure.Search.Documents package to retrieve Azure Search Indexes using a cancellation token.
Code :
Output :
The code ran successfully and retrieved the index as below.
The cancellation token parameter of GetIndexesAsync is optional and does not need to be passed if you do not wish to cancel the operation.
It can be called simply as:
In the real world, you’d use it similar to: