-
Notifications
You must be signed in to change notification settings - Fork 446
/
Copy pathITokenProviderFactory.cs
35 lines (33 loc) · 1.35 KB
/
ITokenProviderFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Diagnostics.CodeAnalysis;
namespace WebApiClientCore.Extensions.OAuths
{
/// <summary>
/// Token提供者工厂接口
/// </summary>
public interface ITokenProviderFactory
{
/// <summary>
/// 通过接口类型获取或创建其对应的 token 提供者
/// </summary>
/// <param name="httpApiType">接口类型</param>
/// <param name="typeMatchMode">类型匹配模式</param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
ITokenProvider Create(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type httpApiType,
TypeMatchMode typeMatchMode = TypeMatchMode.TypeOnly);
/// <summary>
/// 通过接口类型获取或创建其对应的 token 提供者
/// </summary>
/// <param name="httpApiType">接口类型</param>
/// <param name="typeMatchMode">类型匹配模式</param>
/// <param name="alias">TokenProvider的别名</param>
/// <returns></returns>
/// <exception cref="InvalidOperationException"></exception>
ITokenProvider Create(
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type httpApiType,
TypeMatchMode typeMatchMode,
string alias);
}
}