Exemplo n.º 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var configuration = Fx.Construction.Configuration;

            var options = new AliyunOSSClientOptions();

            configuration.GetSection(nameof(AliyunOSSClientOptions)).Bind(options);

            services.AddSingleton(sp => new OssClient(options.EndPoint, options.AccessKeyId, options.AccessKeySecret));
            services.AddSingleton <IOSSClient>(sp => new AliyunOSSClient(sp.GetRequiredService <OssClient>(), options));
        }
Exemplo n.º 2
0
 public AliyunOSSClient(IOss client, AliyunOSSClientOptions options)
 {
     _client  = client;
     _options = options;
 }