Class FinancialDataClientExtensions
- Namespace
- Tudormobile.FinancialData.Extensions
- Assembly
- Tudormobile.FinancialData.dll
Provides extension methods for working with instances of IFinancialDataClient.
public static class FinancialDataClientExtensions
- Inheritance
-
FinancialDataClientExtensions
- Inherited Members
Remarks
This class contains static methods that extend the functionality of IFinancialDataClient implementations, enabling fluent configuration and builder patterns. These extensions are intended to simplify client setup and integration scenarios.
The code uses the newer C# extension method syntax with the 'extension' keyword for better readability and conciseness.
Methods
Create(string, HttpClient, ILogger)
Creates and initializes a new instance of the IFinancialDataClient class.
public static IFinancialDataClient Create(string apiKey, HttpClient httpClient, ILogger logger)
Parameters
apiKeystringThe API key used for authenticating requests to the financial data service.
httpClientHttpClientThe HTTP client used for sending requests to the API.
loggerILoggerOptional logger instance for logging diagnostic information. If null, a NullLogger will be used.
Returns
Create(string, HttpClient, IFinancialDataSerializer, ILogger)
Creates and initializes a new instance of the IFinancialDataClient class.
public static IFinancialDataClient Create(string apiKey, HttpClient httpClient, IFinancialDataSerializer serializer, ILogger logger)
Parameters
apiKeystringThe API key used for authenticating requests to the financial data service.
httpClientHttpClientThe HTTP client used for sending requests to the API.
serializerIFinancialDataSerializerOptional serializer instance for serializing and deserializing API data. If null, the internal serializer will be used.
loggerILoggerOptional logger instance for logging diagnostic information. If null, a NullLogger will be used.
Returns
GetBuilder()
Creates a new builder for configuring and constructing an instance of a Financial Data client.
public static IFinancialDataClientBuilder GetBuilder()
Returns
- IFinancialDataClientBuilder
An IFinancialDataClientBuilder that can be used to configure and build an IFinancialDataClient instance.