moved ConfigureAwait onto same line as await

This commit is contained in:
Brendan Forster
2016-04-06 20:27:13 -04:00
parent 5b3d540207
commit c1c035cf01
7 changed files with 13 additions and 46 deletions
+1 -2
View File
@@ -66,8 +66,7 @@ namespace Octokit
try
{
var response = await Connection.Get<object>(ApiUrls.CheckAssignee(owner, name, assignee), null, null)
.ConfigureAwait(false);
var response = await Connection.Get<object>(ApiUrls.CheckAssignee(owner, name, assignee), null, null).ConfigureAwait(false);
return response.HttpResponse.IsTrue();
}
catch (NotFoundException)
+2 -4
View File
@@ -244,8 +244,7 @@ namespace Octokit
try
{
var response = await Connection.Get<object>(ApiUrls.CheckMemberPublic(org, user), null, null)
.ConfigureAwait(false);
var response = await Connection.Get<object>(ApiUrls.CheckMemberPublic(org, user), null, null).ConfigureAwait(false);
return response.HttpResponse.IsTrue();
}
catch (NotFoundException)
@@ -293,8 +292,7 @@ namespace Octokit
try
{
var requestData = new { };
var response = await Connection.Put<object>(ApiUrls.OrganizationMembership(org, user), requestData)
.ConfigureAwait(false);
var response = await Connection.Put<object>(ApiUrls.OrganizationMembership(org, user), requestData).ConfigureAwait(false);
if (response.HttpResponse.StatusCode != HttpStatusCode.NoContent)
{
throw new ApiException("Invalid Status Code returned. Expected a 204", response.HttpResponse.StatusCode);
+1 -2
View File
@@ -57,8 +57,7 @@ namespace Octokit
try
{
var response = await Connection.Get<object>(endpoint, null, null)
.ConfigureAwait(false);
var response = await Connection.Get<object>(endpoint, null, null).ConfigureAwait(false);
return response.HttpResponse.IsTrue();
}
catch (NotFoundException)
+3 -9
View File
@@ -189,9 +189,7 @@ namespace Octokit
try
{
var response = await Connection.Get<object>(ApiUrls.Starred(owner, name), null, null)
.ConfigureAwait(false);
var response = await Connection.Get<object>(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false);
return response.HttpResponse.StatusCode == HttpStatusCode.NoContent;
}
catch (NotFoundException)
@@ -213,9 +211,7 @@ namespace Octokit
try
{
var response = await Connection.Put<object>(ApiUrls.Starred(owner, name), null, null)
.ConfigureAwait(false);
var response = await Connection.Put<object>(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false);
return response.HttpResponse.StatusCode == HttpStatusCode.NoContent;
}
catch (NotFoundException)
@@ -237,9 +233,7 @@ namespace Octokit
try
{
var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name))
.ConfigureAwait(false);
var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name)).ConfigureAwait(false);
return statusCode == HttpStatusCode.NoContent;
}
catch (NotFoundException)
+1 -2
View File
@@ -41,8 +41,7 @@ namespace Octokit
TwoFactorRequiredException twoFactorException = null;
try
{
return await authorizationsClient.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization)
.ConfigureAwait(false);
return await authorizationsClient.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization).ConfigureAwait(false);
}
catch (TwoFactorRequiredException exception)
{
+4 -19
View File
@@ -181,8 +181,7 @@ namespace Octokit
parameters = Pagination.Setup(parameters, options);
return _pagination.GetAllPages(async () => await GetPage<T>(uri, parameters, accepts, options)
.ConfigureAwait(false), uri);
return _pagination.GetAllPages(async () => await GetPage<T>(uri, parameters, accepts, options).ConfigureAwait(false), uri);
}
/// <summary>
@@ -258,11 +257,7 @@ namespace Octokit
Ensure.ArgumentNotNull(uri, "uri");
Ensure.ArgumentNotNull(data, "data");
var response = await Connection.Post<T>(
uri,
data,
accepts,
contentType).ConfigureAwait(false);
var response = await Connection.Post<T>(uri, data, accepts, contentType).ConfigureAwait(false);
return response.Body;
}
@@ -283,12 +278,7 @@ namespace Octokit
Ensure.ArgumentNotNull(data, "data");
Ensure.ArgumentNotNull(twoFactorAuthenticationCode, "twoFactorAuthenticationCode");
var response = await Connection.Post<T>(
uri,
data,
accepts,
contentType,
twoFactorAuthenticationCode).ConfigureAwait(false);
var response = await Connection.Post<T>(uri, data, accepts, contentType, twoFactorAuthenticationCode).ConfigureAwait(false);
return response.Body;
}
@@ -298,12 +288,7 @@ namespace Octokit
Ensure.ArgumentNotNull(uri, "uri");
Ensure.ArgumentNotNull(data, "data");
var response = await Connection.Post<T>(
uri,
data,
accepts,
contentType,
timeout).ConfigureAwait(false);
var response = await Connection.Post<T>(uri, data, accepts, contentType, timeout).ConfigureAwait(false);
return response.Body;
}
+1 -8
View File
@@ -451,14 +451,7 @@ namespace Octokit
{
Ensure.ArgumentNotNull(uri, "uri");
var response = await SendData<object>(
uri,
HttpMethod.Delete,
null,
null,
null,
CancellationToken.None,
twoFactorAuthenticationCode).ConfigureAwait(false);
var response = await SendData<object>(uri, HttpMethod.Delete, null, null, null, CancellationToken.None, twoFactorAuthenticationCode).ConfigureAwait(false);
return response.HttpResponse.StatusCode;
}