コード例 #1
0
        public static IServiceCollection AddFliptClient(this IServiceCollection services, Action <IServiceProvider, FliptClientConfiguration> configBuilder = null, ServiceLifetime lifetime = ServiceLifetime.Scoped)
        {
            services.Add(new ServiceDescriptor(typeof(IFliptAPIClient), typeof(FliptAPIClient), lifetime));
            if (configBuilder != null)
            {
                services.Add(new ServiceDescriptor(typeof(FliptClientConfiguration), (sp) =>
                {
                    var cfg = new FliptClientConfiguration();
                    configBuilder?.Invoke(sp, cfg);
                    return(cfg);
                }, lifetime));
            }

            return(services);
        }
コード例 #2
0
 public FliptClientBase(FliptClientConfiguration configuration)
 {
     this.Configuration = configuration;
 }