When adding AWS Services to Services Collection in .NET Core, should I go with the default which well add as a Singleton or should I use the override to set as Transient?
For reference, displaying default option (Singleton) for DynamoDB and Transient for SQS:
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
services.AddHttpContextAccessor();
// Add AWS Services
services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
services.AddAWSService<IAmazonDynamoDB>();
services.AddAWSService<IAmazonSQS>(lifetime: ServiceLifetime.Transient);
}
I've seen many examples go with the default, but reading the is article suggests going with Transient unless there is a reason to go with Singleton: https://dotnetcoretutorials.com/2017/03/25/net-core-dependency-injection-lifetimes-explained/#comments