Class EncProductCatalogClient
HTTP client for downloading and deserializing NOAA ENC product catalogs.
public class EncProductCatalogClient : IDisposable
- Inheritance
-
EncProductCatalogClient
- Implements
- Inherited Members
Constructors
EncProductCatalogClient(HttpClient?)
Initializes a new instance of the EncProductCatalogClient class.
public EncProductCatalogClient(HttpClient? httpClient = null)
Parameters
httpClientHttpClientAn optional HttpClient to use for requests. If null, a new instance is created.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetCatalogAsync(string, CancellationToken)
Downloads and deserializes an ENC product catalog from the specified URL.
public Task<EncProductCatalog> GetCatalogAsync(string url, CancellationToken cancellationToken = default)
Parameters
urlstringThe URL of the catalog XML.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<EncProductCatalog>
The deserialized EncProductCatalog.
GetNoaaCatalogAsync(CancellationToken)
Downloads and deserializes the official NOAA ENC product catalog.
public Task<EncProductCatalog> GetNoaaCatalogAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<EncProductCatalog>
The deserialized EncProductCatalog.