20 lines
585 B
C#
20 lines
585 B
C#
using Aliyun.OSS;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Hncore.Pass.OSS.Utils
|
|
{
|
|
public static class AliOssClientExt
|
|
{
|
|
public static IServiceCollection AddAliOssClient(this IServiceCollection services, string AliEndpoint, string AliAccessId, string AliAccessKey)
|
|
{
|
|
OssClient client = new OssClient(AliEndpoint, AliAccessId, AliAccessKey);
|
|
services.AddSingleton(client);
|
|
return services;
|
|
}
|
|
}
|
|
}
|