初始提交
This commit is contained in:
19
Services/Hncore.Pass.OSS/Utils/AliOssClient.cs
Normal file
19
Services/Hncore.Pass.OSS/Utils/AliOssClient.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user