Skip to content

Commit d66b19b

Browse files
committed
移除Disposeable
1 parent 19c016d commit d66b19b

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

WebApiClientCore.Extensions.OAuths/TokenProviders/TokenProvider.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace WebApiClientCore.Extensions.OAuths.TokenProviders
99
/// <summary>
1010
/// 表示Token提供者抽象类
1111
/// </summary>
12-
public abstract class TokenProvider : Disposable, ITokenProvider
12+
public abstract class TokenProvider : ITokenProvider
1313
{
1414
/// <summary>
1515
/// 最近请求到的token
@@ -56,7 +56,6 @@ public TOptions GetOptionsValue<TOptions>()
5656
/// </summary>
5757
public void ClearToken()
5858
{
59-
this.CheckDisposed();
6059
using (this.asyncRoot.Lock())
6160
{
6261
this.token = null;
@@ -69,7 +68,6 @@ public void ClearToken()
6968
/// <returns></returns>
7069
public async Task<TokenResult> GetTokenAsync()
7170
{
72-
this.CheckDisposed();
7371
using (await this.asyncRoot.LockAsync().ConfigureAwait(false))
7472
{
7573
if (this.token == null)
@@ -110,15 +108,6 @@ public async Task<TokenResult> GetTokenAsync()
110108
/// <returns></returns>
111109
protected abstract Task<TokenResult?> RefreshTokenAsync(IServiceProvider serviceProvider, string refresh_token);
112110

113-
/// <summary>
114-
/// 释放资源
115-
/// </summary>
116-
/// <param name="disposing"></param>
117-
protected override void Dispose(bool disposing)
118-
{
119-
this.asyncRoot.Dispose();
120-
}
121-
122111
/// <summary>
123112
/// 转换为string
124113
/// </summary>
@@ -127,16 +116,5 @@ public override string ToString()
127116
{
128117
return this.Name;
129118
}
130-
131-
/// <summary>
132-
/// 检查释放
133-
/// </summary>
134-
private void CheckDisposed()
135-
{
136-
if (this.IsDisposed == true)
137-
{
138-
throw new ObjectDisposedException(this.GetType().Name);
139-
}
140-
}
141119
}
142120
}

0 commit comments

Comments
 (0)