Can you plase provide some guidance on how to pass some references to other registrations ?
//registration of 1st http client
builder.RegisterType<HttpClient>()
//.Keyed<HttpMessageInvoker>("authHttpClient")
.WithProperties(new[] { new NamedPropertyParameter("PooledConnectionLifetime", 2 })
.WithProperties(new[] { new NamedPropertyParameter("BaseAddress", "whatever"))})
.SingleInstance();
//registration of 2nd httpclient
builder.RegisterType<HttpClient>()
.Keyed<HttpMessageInvoker>("dynamicsHttpClient")
.WithProperties(new[] { new NamedPropertyParameter("PooledConnectionLifetime", 20) })
.WithProperties(new[] { new NamedPropertyParameter("BaseAddress", "other something" })
.SingleInstance();
// **I need to do the registration of type and pass the 1st httpClient registration**
builder.RegisterType<DynamicsAuthApiGateway>()
.As<IDynamicsAuthApiGateway>()
// **I need to do the registration of type pass 2nd instance of httpClient registration**
builder.RegisterType<DynamicsApiGateway>()
.As<IDynamicsApiGateway>()
.SingleInstance();
//Method ctor's
//DynamicsAuthApiGateway(**HttpClient client**, DynamicsAuthApiGatewaySettings apiGatewaySettings)
//DynamicsApiGateway(**HttpClient client**, Func<HttpResponseMessage, Task> errorHandler = null)
Can you help on how to achieve that ?
Any help would be appreciated ?
Thanks, ME