A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
Dependency Injection: one interface multiple times
hello all,
using .net core .31 i have a situation that in Dependency injection i have to use one Interface with different url's. below is my existing code.
public static IServiceCollection ResolveDependencies(this IServiceCollection services, IConfiguration configuration)
{
var graphQlHttpClient = new GraphQLHttpClient(
configuration["MyGraphqlLink"],
new NewtonsoftJsonSerializer());
services.AddSingleton<IGraphQLClient>(s => graphQlHttpClient);
}
above is existing code and its working fine. but, i have a scenario that i have to use 2 or 3 graphql link also in the same section so, may i know how do i use GraphQLHttpClient
with 2 or 3 different URL's?
experts kindly support.