Closed matheusfellipe closed 4 months ago
I'm getting DI error using the connection dictionary in service collection extensions method, like
public static IServiceCollection AddB1SLayer(this IServiceCollection services, IConfiguration configuration) { services.AddSingleton(serviceLayer => new Dictionary<string,SLConnection>() { { "foo", new SLConnection(configuration["Url"], "companyDb", configuration["UserName"], configuration["PassWord"]) }, { "boo", new SLConnection(configuration["Url"], "companyDb", configuration["UserName"], configuration["PassWord"]) } }); return services; }
}
Hi! What's the error? Can you provide us the Stack Traces? Also, where is the exception thrown?
I was injecting SLConnection rather than the dictionary
I'm getting DI error using the connection dictionary in service collection extensions method, like
}