mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 20:13:40 +00:00
Prefer using nameof(x) over literal "x" (#1781)
* updated XML docs and added some missing bits. * prefer nameof(x) over literal "x"
This commit is contained in:
committed by
Ryan Gribble
parent
c223f5ae9a
commit
4e804f61a6
@@ -21,8 +21,8 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public static Task<IReadOnlyList<T>> GetAll<T>(this IApiConnection connection, Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(connection, nameof(connection));
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return connection.GetAll<T>(uri, ApiOptions.None);
|
||||
}
|
||||
@@ -36,8 +36,8 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public static Task<string> GetHtml(this IApiConnection connection, Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(connection, nameof(connection));
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return connection.GetHtml(uri, null);
|
||||
}
|
||||
@@ -50,8 +50,8 @@ namespace Octokit
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
public static Task<IApiResponse<string>> GetHtml(this IConnection connection, Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(connection, nameof(connection));
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return connection.GetHtml(uri, null);
|
||||
}
|
||||
@@ -66,8 +66,8 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public static Task<IApiResponse<T>> GetResponse<T>(this IConnection connection, Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(connection, nameof(connection));
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return connection.Get<T>(uri, null, null);
|
||||
}
|
||||
@@ -83,8 +83,8 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public static Task<IApiResponse<T>> GetResponse<T>(this IConnection connection, Uri uri, CancellationToken cancellationToken)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(connection, nameof(connection));
|
||||
Ensure.ArgumentNotNull(uri, nameof(uri));
|
||||
|
||||
return connection.Get<T>(uri, null, null, cancellationToken);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
public static bool IsTrue(this IResponse response)
|
||||
{
|
||||
Ensure.ArgumentNotNull(response, "response");
|
||||
Ensure.ArgumentNotNull(response, nameof(response));
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.NotFound && response.StatusCode != HttpStatusCode.NoContent)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user