Ejemplo n.º 1
0
        public static void AddDigitServiceClient(this IServiceCollection services,
                                                 DigitServiceOptions options,
                                                 IAuthenticationProviderBuilder authenticationProviderBuilder)
        {
            var factory = authenticationProviderBuilder.GetFactory();

            services.Configure <DigitServiceOptions>(v =>
            {
                v.DigitServiceBaseUri = options.DigitServiceBaseUri;
                v.LogAuthor           = options.LogAuthor;
            });
            services.AddTransient <IDigitServiceClient>(v => new DigitServiceClient(factory(v), v.GetService <IOptions <DigitServiceOptions> >()));
        }
Ejemplo n.º 2
0
 public DigitServiceClient(IAuthenticationProvider authenticationProvider, IOptions <DigitServiceOptions> optionsAccessor)
 {
     options = optionsAccessor.Value;
     this.authenticationProvider = authenticationProvider;
 }