Class CogniteExtensions
Extension utilities for the Cognite client
Inherited Members
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public static class CogniteExtensions
Methods
| Edit this page View SourceAddExtensionLoggers(IServiceProvider)
Add logger to client extension methods.
Declaration
public static void AddExtensionLoggers(this IServiceProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | provider | Serviceprovider to use to get the loggers |
GetRetryPolicy(ILogger?, int?, int?)
Create a polly retry policy configured for use with CDF.
Declaration
public static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy(ILogger? logger, int? maxRetries, int? maxDelay)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | Logger to use on retry |
int? | maxRetries | Maximum number of retries |
int? | maxDelay | Maximum delay between each retry in milliseconds, negative for no upper limit |
Returns
Type | Description |
---|---|
IAsyncPolicy<HttpResponseMessage> |
GetTimeoutPolicy(int?)
Get a polly timeout policy with a timeout set to timeout
milliseconds
Declaration
public static IAsyncPolicy<HttpResponseMessage> GetTimeoutPolicy(int? timeout)
Parameters
Type | Name | Description |
---|---|---|
int? | timeout | Timeout on each request in milliseconds |
Returns
Type | Description |
---|---|
IAsyncPolicy<HttpResponseMessage> |