mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 04:40:54 +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
@@ -32,8 +32,8 @@ namespace Octokit
|
||||
/// <param name="number">The id of the deploy key.</param>
|
||||
public Task<DeployKey> Get(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Get<DeployKey>(ApiUrls.RepositoryDeployKey(owner, name, number));
|
||||
}
|
||||
@@ -61,8 +61,8 @@ namespace Octokit
|
||||
/// <param name="name">The name of the repository.</param>
|
||||
public Task<IReadOnlyList<DeployKey>> GetAll(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return GetAll(owner, name, ApiOptions.None);
|
||||
}
|
||||
@@ -90,9 +90,9 @@ namespace Octokit
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public Task<IReadOnlyList<DeployKey>> GetAll(string owner, string name, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<DeployKey>(ApiUrls.RepositoryDeployKeys(owner, name), options);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ namespace Octokit
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public Task<IReadOnlyList<DeployKey>> GetAll(long repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<DeployKey>(ApiUrls.RepositoryDeployKeys(repositoryId), options);
|
||||
}
|
||||
@@ -123,9 +123,9 @@ namespace Octokit
|
||||
/// <param name="newDeployKey">The deploy key to create for the repository.</param>
|
||||
public Task<DeployKey> Create(string owner, string name, NewDeployKey newDeployKey)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(newDeployKey, "newDeployKey");
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(newDeployKey, nameof(newDeployKey));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(newDeployKey.Title))
|
||||
throw new ArgumentException("The new deploy key's title must not be null.");
|
||||
@@ -146,7 +146,7 @@ namespace Octokit
|
||||
/// <param name="newDeployKey">The deploy key to create for the repository.</param>
|
||||
public Task<DeployKey> Create(long repositoryId, NewDeployKey newDeployKey)
|
||||
{
|
||||
Ensure.ArgumentNotNull(newDeployKey, "newDeployKey");
|
||||
Ensure.ArgumentNotNull(newDeployKey, nameof(newDeployKey));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(newDeployKey.Title))
|
||||
throw new ArgumentException("The new deploy key's title must not be null.");
|
||||
@@ -168,8 +168,8 @@ namespace Octokit
|
||||
/// <param name="number">The id of the deploy key to delete.</param>
|
||||
public Task Delete(string owner, string name, int number)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return ApiConnection.Delete(ApiUrls.RepositoryDeployKey(owner, name, number));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user