Skip to content

Commit f0baafa

Browse files
committed
单词拼写错误修正
1 parent 4de1a57 commit f0baafa

File tree

14 files changed

+70
-71
lines changed

14 files changed

+70
-71
lines changed

WebApiClient.Test/HttpApiFactoryTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private HttpMessageHandler GetHttpHandler(IHttpApi ihttpApi)
3737
{
3838
var httpApi = ihttpApi as HttpApi;
3939
var interceptor = httpApi.ApiInterceptor as ApiInterceptor;
40-
return interceptor.HttpApiConfig.HttpHandler.SourceHanlder;
40+
return interceptor.HttpApiConfig.HttpHandler.SourceHandler;
4141
}
4242
public interface IMyApi : IHttpApi
4343
{

WebApiClient.Test/HttpApiTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private HttpMessageHandler GetHttpHandler(IHttpApi ihttpApi)
7575
{
7676
var httpApi = ihttpApi as HttpApi;
7777
var interceptor = httpApi.ApiInterceptor as ApiInterceptor;
78-
return interceptor.HttpApiConfig.HttpHandler.SourceHanlder;
78+
return interceptor.HttpApiConfig.HttpHandler.SourceHandler;
7979
}
8080
}
8181
}

WebApiClient/Attributes/ParameterAttributes/PathQueryAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public async Task BeforeRequestAsync(ApiActionContext context, ApiParameterDescr
9797
.HttpApiConfig
9898
.KeyValueFormatter
9999
.Serialize(parameter, options)
100-
.FormateAs(this.CollectionFormat);
100+
.FormatAs(this.CollectionFormat);
101101

102102
context.RequestMessage.RequestUri = this.UsePathQuery(uri, keyValues);
103103
await ApiTask.CompletedTask;

WebApiClient/Contexts/ApiParameterDescriptor.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private class ParameterAttributeCollection : IEnumerable<IApiParameterAttribute>
161161
/// <summary>
162162
/// 特性列表
163163
/// </summary>
164-
private readonly List<IApiParameterAttribute> attribueList = new List<IApiParameterAttribute>();
164+
private readonly List<IApiParameterAttribute> attributeList = new List<IApiParameterAttribute>();
165165

166166
/// <summary>
167167
/// 获取元素数量
@@ -170,7 +170,7 @@ public int Count
170170
{
171171
get
172172
{
173-
return this.attribueList.Count;
173+
return this.attributeList.Count;
174174
}
175175
}
176176

@@ -180,7 +180,7 @@ public int Count
180180
/// <param name="defined">声明的特性</param>
181181
public ParameterAttributeCollection(IEnumerable<IApiParameterAttribute> defined)
182182
{
183-
this.attribueList.AddRange(defined);
183+
this.attributeList.AddRange(defined);
184184
}
185185

186186
/// <summary>
@@ -189,7 +189,7 @@ public ParameterAttributeCollection(IEnumerable<IApiParameterAttribute> defined)
189189
/// <param name="attribute">新特性</param>
190190
public void Add(IApiParameterAttribute attribute)
191191
{
192-
this.attribueList.Add(attribute);
192+
this.attributeList.Add(attribute);
193193
}
194194

195195
/// <summary>
@@ -200,12 +200,12 @@ public void Add(IApiParameterAttribute attribute)
200200
public bool AddIfNotExists(IApiParameterAttribute attribute)
201201
{
202202
var type = attribute.GetType();
203-
if (this.attribueList.Any(item => item.GetType() == type) == true)
203+
if (this.attributeList.Any(item => item.GetType() == type) == true)
204204
{
205205
return false;
206206
}
207207

208-
this.attribueList.Add(attribute);
208+
this.attributeList.Add(attribute);
209209
return true;
210210
}
211211

@@ -215,7 +215,7 @@ public bool AddIfNotExists(IApiParameterAttribute attribute)
215215
/// <returns></returns>
216216
public IEnumerator<IApiParameterAttribute> GetEnumerator()
217217
{
218-
return this.attribueList.GetEnumerator();
218+
return this.attributeList.GetEnumerator();
219219
}
220220

221221
/// <summary>

WebApiClient/Defaults/Internal/KeyValuesWriter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class KeyValuesWriter : JsonWriter, IEnumerable<KeyValuePair<string, string>>
1616
/// <summary>
1717
/// 当前属性名称
1818
/// </summary>
19-
private string properyName;
19+
private string propertyName;
2020

2121
/// <summary>
2222
/// 保存KeyValuePair的列表
@@ -29,7 +29,7 @@ class KeyValuesWriter : JsonWriter, IEnumerable<KeyValuePair<string, string>>
2929
/// <param name="name">对象名称</param>
3030
public KeyValuesWriter(string name)
3131
{
32-
this.properyName = name;
32+
this.propertyName = name;
3333
}
3434

3535
/// <summary>
@@ -38,7 +38,7 @@ public KeyValuesWriter(string name)
3838
/// <param name="value">值</param>
3939
private void AddStringItem(string value)
4040
{
41-
var item = new KeyValuePair<string, string>(this.properyName, value);
41+
var item = new KeyValuePair<string, string>(this.propertyName, value);
4242
this.keyValues.Add(item);
4343
}
4444

@@ -67,7 +67,7 @@ private void AddNullableItem<T>(T value)
6767
/// <param name="escape"></param>
6868
public override void WritePropertyName(string name, bool escape)
6969
{
70-
this.properyName = name;
70+
this.propertyName = name;
7171
}
7272

7373
/// <summary>
@@ -76,7 +76,7 @@ public override void WritePropertyName(string name, bool escape)
7676
/// <param name="name"></param>
7777
public override void WritePropertyName(string name)
7878
{
79-
this.properyName = name;
79+
this.propertyName = name;
8080
}
8181

8282
/// <summary>
@@ -135,7 +135,7 @@ public override void WriteValue(byte[] value)
135135
}
136136
else
137137
{
138-
throw new NotSupportedException($"不支持序列化{this.properyName} {value}");
138+
throw new NotSupportedException($"不支持序列化{this.propertyName} {value}");
139139
}
140140
}
141141

WebApiClient/HttpProxy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ private void SetCredentialsByInterface(ICredentials value)
120120
var password = default(string);
121121
if (value != null)
122122
{
123-
var networkCredentialsd = value.GetCredential(null, null);
124-
userName = networkCredentialsd?.UserName;
125-
password = networkCredentialsd?.Password;
123+
var networkCredentials = value.GetCredential(null, null);
124+
userName = networkCredentials?.UserName;
125+
password = networkCredentials?.Password;
126126
}
127127

128128
this.UserName = userName;

WebApiClient/IHttpHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface IHttpHandler : IDisposable
1515
/// <summary>
1616
/// 获取原始的Handler对象
1717
/// </summary>
18-
HttpMessageHandler SourceHanlder { get; }
18+
HttpMessageHandler SourceHandler { get; }
1919

2020
/// <summary>
2121
/// 获取或设置是否使用CookieContainer来管理Cookies

WebApiClient/Internal/Extensions/AttributeExtensions.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public static TAttribute GetAttribute<TAttribute>(this MemberInfo member, bool i
6767
{
6868
return member
6969
.GetCustomAttributes(inherit)
70-
.Select(item => item as TAttribute)
71-
.FirstOrDefault(item => item != null);
70+
.OfType<TAttribute>()
71+
.FirstOrDefault();
7272
}
7373

7474
/// <summary>
@@ -82,8 +82,7 @@ private static IEnumerable<TAttribute> GetAttributes<TAttribute>(this MemberInfo
8282
{
8383
return member
8484
.GetCustomAttributes(inherit)
85-
.Select(item => item as TAttribute)
86-
.Where(item => item != null);
85+
.OfType<TAttribute>();
8786
}
8887
}
8988
}

WebApiClient/Internal/Extensions/CollectionExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static class CollectionExtensions
1515
/// <param name="collection">集合</param>
1616
/// <param name="format">格式</param>
1717
/// <returns></returns>
18-
public static IEnumerable<KeyValuePair<string, string>> FormateAs(this IEnumerable<KeyValuePair<string, string>> collection, CollectionFormat format)
18+
public static IEnumerable<KeyValuePair<string, string>> FormatAs(this IEnumerable<KeyValuePair<string, string>> collection, CollectionFormat format)
1919
{
2020
if (format == CollectionFormat.Multi)
2121
{
@@ -25,16 +25,16 @@ public static IEnumerable<KeyValuePair<string, string>> FormateAs(this IEnumerab
2525
switch (format)
2626
{
2727
case CollectionFormat.Csv:
28-
return collection.FormateAs(@",");
28+
return collection.FormatAs(@",");
2929

3030
case CollectionFormat.Ssv:
31-
return collection.FormateAs(@" ");
31+
return collection.FormatAs(@" ");
3232

3333
case CollectionFormat.Tsv:
34-
return collection.FormateAs(@"\");
34+
return collection.FormatAs(@"\");
3535

3636
case CollectionFormat.Pipes:
37-
return collection.FormateAs(@"|");
37+
return collection.FormatAs(@"|");
3838

3939
default:
4040
throw new NotImplementedException();
@@ -47,7 +47,7 @@ public static IEnumerable<KeyValuePair<string, string>> FormateAs(this IEnumerab
4747
/// <param name="collection">集合</param>
4848
/// <param name="separator">分隔符</param>
4949
/// <returns></returns>
50-
private static IEnumerable<KeyValuePair<string, string>> FormateAs(this IEnumerable<KeyValuePair<string, string>> collection, string separator)
50+
private static IEnumerable<KeyValuePair<string, string>> FormatAs(this IEnumerable<KeyValuePair<string, string>> collection, string separator)
5151
{
5252
return collection.GroupBy(item => item.Key).Select(item =>
5353
{

WebApiClient/Internal/HttpHandlers/HttpHandlerOfHttpClientHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class HttpHandlerOfHttpClientHandler : IHttpHandler
2020
/// <summary>
2121
/// 获取原始的Handler对象
2222
/// </summary>
23-
public HttpMessageHandler SourceHanlder { get; private set; }
23+
public HttpMessageHandler SourceHandler { get; private set; }
2424

2525
/// <summary>
2626
/// 获取或设置是否使用CookieContainer来管理Cookies
@@ -229,15 +229,15 @@ public Func<X509Certificate, X509Chain, SslPolicyErrors, bool> ServerCertificate
229229
public HttpHandlerOfHttpClientHandler(HttpClientHandler clientHandler, HttpMessageHandler sourceHandler)
230230
{
231231
this.clientHandler = clientHandler;
232-
this.SourceHanlder = sourceHandler;
232+
this.SourceHandler = sourceHandler;
233233
}
234234

235235
/// <summary>
236236
/// 释放资源
237237
/// </summary>
238238
public void Dispose()
239239
{
240-
this.SourceHanlder.Dispose();
240+
this.SourceHandler.Dispose();
241241
}
242242
}
243243
}

0 commit comments

Comments
 (0)