Describe the feature
There is a way for most of the services to add them with extension method TryAddAwsService / TryAddAWSService, depending whether there's usage of LocalStack involved or not, but not for IAmazonApiGatewayManagementApi... As I couldn't find a way to configure ServiceURL, except explicitly adding the service as a Transient and providing new object initialization lambda definition as a parameter as shown in example:
public static IServiceCollection AddService(this IServiceCollection services, IConfiguration configuration)
{
return services
.AddLocalStack(configuration)
.AddDefaultAWSOptions(configuration.GetAWSOptions())
.AddTransient<IAmazonApiGatewayManagementApi>(_ =>
new AmazonApiGatewayManagementApiClient(
new AmazonApiGatewayManagementApiConfig
{
ServiceURL = "wss://someurl"
}));
}
Is there more authentic way to add the interface in a service collection using TryAddAwsService and configure ServiceURL ?
I'm searching for something similar to this:
public static IServiceCollection AddService(this IServiceCollection services, IConfiguration configuration)
{
return services
.AddLocalStack(configuration)
.AddDefaultAwsOptions(configuration.GetAWSOptions())
.Configure<AmazonApiGatewayManagementApiConfig>(config =>
{
config.ServiceURL = "wss://someurl";
})
.TryAddAwsService<IAmazonApiGatewayManagementApi>(ServiceLifetime.Transient);
}
But obviously this code doesn't work....
Use Case
I want to add IAmazonApiGatewayManagementApi in IoC container and configure it.
Proposed Solution
No response
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
Latest
Targeted .NET Platform
.NET 6
Operating System and version
Any
Describe the feature
There is a way for most of the services to add them with extension method
TryAddAwsService/TryAddAWSService, depending whether there's usage ofLocalStackinvolved or not, but not forIAmazonApiGatewayManagementApi... As I couldn't find a way to configureServiceURL, except explicitly adding the service as aTransientand providing new object initialization lambda definition as a parameter as shown in example:Is there more authentic way to add the interface in a service collection using
TryAddAwsServiceand configureServiceURL?I'm searching for something similar to this:
But obviously this code doesn't work....
Use Case
I want to add
IAmazonApiGatewayManagementApiin IoC container and configure it.Proposed Solution
No response
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
Latest
Targeted .NET Platform
.NET 6
Operating System and version
Any