mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 17:49:54 +08:00
22 lines
877 B
C#
22 lines
877 B
C#
using System.Application.Models;
|
|
using System.Application.Services.Implementation;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Microsoft.Extensions.DependencyInjection
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// 添加短信发送提供商(仅单选一个提供商)
|
|
/// </summary>
|
|
/// <typeparam name="TSmsSettings"></typeparam>
|
|
/// <param name="services"></param>
|
|
/// <param name="name">提供商唯一名称,见 <see cref="ISmsSettings.SmsOptions"/> 中 PropertyName</param>
|
|
/// <returns></returns>
|
|
public static IServiceCollection AddSmsSenderProvider<TSmsSettings>(
|
|
this IServiceCollection services,
|
|
string? name)
|
|
where TSmsSettings : class, ISmsSettings
|
|
=> SmsSenderBase.Add<TSmsSettings>(services, name);
|
|
}
|
|
} |