Class AlpacaServiceCollectionExtensions
Set of extensions methods for registering the strongly-typed Alpaca REST API clients in the default Microsoft dependency injection container used by most .NET hosts.
Inheritance
Inherited Members
Namespace: Alpaca.Markets.Extensions
Assembly: Alpaca.Markets.Extensions.dll
Syntax
public static class AlpacaServiceCollectionExtensions
Methods
| Improve this Doc View SourceAddAlpacaCryptoDataClient(IServiceCollection, AlpacaCryptoDataClientConfiguration)
Registers the concrete implementation of the IAlpacaCryptoDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaCryptoDataClient(this IServiceCollection services, AlpacaCryptoDataClientConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
AlpacaCryptoDataClientConfiguration | configuration | Alpaca data client configuration. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaCryptoDataClient(IServiceCollection, IEnvironment, SecurityKey)
Registers the concrete implementation of the IAlpacaCryptoDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaCryptoDataClient(this IServiceCollection services, IEnvironment environment, SecurityKey securityKey)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
IEnvironment | environment | Alpaca environment data. |
SecurityKey | securityKey | Alpaca security key. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaDataClient(IServiceCollection, AlpacaDataClientConfiguration)
Registers the concrete implementation of the IAlpacaDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaDataClient(this IServiceCollection services, AlpacaDataClientConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
AlpacaDataClientConfiguration | configuration | Alpaca data client configuration. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaDataClient(IServiceCollection, IEnvironment, SecurityKey)
Registers the concrete implementation of the IAlpacaDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaDataClient(this IServiceCollection services, IEnvironment environment, SecurityKey securityKey)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
IEnvironment | environment | Alpaca environment data. |
SecurityKey | securityKey | Alpaca security key. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaOptionsDataClient(IServiceCollection, AlpacaOptionsDataClientConfiguration)
Registers the concrete implementation of the IAlpacaOptionsDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaOptionsDataClient(this IServiceCollection services, AlpacaOptionsDataClientConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
AlpacaOptionsDataClientConfiguration | configuration | Alpaca data client configuration. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaOptionsDataClient(IServiceCollection, IEnvironment, SecurityKey)
Registers the concrete implementation of the IAlpacaOptionsDataClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaOptionsDataClient(this IServiceCollection services, IEnvironment environment, SecurityKey securityKey)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
IEnvironment | environment | Alpaca environment data. |
SecurityKey | securityKey | Alpaca security key. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaTradingClient(IServiceCollection, AlpacaTradingClientConfiguration)
Registers the concrete implementation of the IAlpacaTradingClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaTradingClient(this IServiceCollection services, AlpacaTradingClientConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
AlpacaTradingClientConfiguration | configuration | Alpaca trading client configuration. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |
AddAlpacaTradingClient(IServiceCollection, IEnvironment, SecurityKey)
Registers the concrete implementation of the IAlpacaTradingClient interface in the services catalog and make it available in constructors.
Declaration
public static IHttpClientBuilder AddAlpacaTradingClient(this IServiceCollection services, IEnvironment environment, SecurityKey securityKey)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | Registered services collection. |
IEnvironment | environment | Alpaca environment data. |
SecurityKey | securityKey | Alpaca security key. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHttpClientBuilder | The Microsoft.Extensions.DependencyInjection.IHttpClientBuilder interface for further HTTP client customization. |