Table of Contents

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

apiKey string

The API key used for authenticating requests to the financial data service.

httpClient HttpClient

The HTTP client used for sending requests to the API.

logger ILogger

Optional logger instance for logging diagnostic information. If null, a NullLogger will be used.

Returns

IFinancialDataClient

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

apiKey string

The API key used for authenticating requests to the financial data service.

httpClient HttpClient

The HTTP client used for sending requests to the API.

serializer IFinancialDataSerializer

Optional serializer instance for serializing and deserializing API data. If null, the internal serializer will be used.

logger ILogger

Optional logger instance for logging diagnostic information. If null, a NullLogger will be used.

Returns

IFinancialDataClient

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.