From 4e804f61a69f41757acbf2a1e4e96dd288e59a57 Mon Sep 17 00:00:00 2001 From: Itai Bar-Haim Date: Wed, 7 Mar 2018 12:43:10 +0200 Subject: [PATCH] Prefer using nameof(x) over literal "x" (#1781) * updated XML docs and added some missing bits. * prefer nameof(x) over literal "x" --- .../ObservableEnterpriseAdminStatsClient.cs | 2 +- .../Enterprise/ObservableEnterpriseClient.cs | 2 +- .../ObservableEnterpriseLdapClient.cs | 2 +- .../ObservableEnterpriseLicenseClient.cs | 2 +- .../ObservableEnterpriseOrganizationClient.cs | 2 +- ...bservableEnterpriseSearchIndexingClient.cs | 2 +- .../Clients/ObservableActivitiesClient.cs | 2 +- .../Clients/ObservableAssigneesClient.cs | 34 +-- .../Clients/ObservableAuthorizationsClient.cs | 40 +-- .../Clients/ObservableBlobClient.cs | 18 +- .../ObservableCommitCommentReactionsClient.cs | 14 +- .../Clients/ObservableCommitStatusClient.cs | 42 +-- .../Clients/ObservableCommitsClient.cs | 18 +- .../ObservableDeploymentStatusClient.cs | 22 +- .../Clients/ObservableDeploymentsClient.cs | 18 +- .../Clients/ObservableEventsClient.cs | 78 ++--- .../Clients/ObservableFeedsClient.cs | 2 +- .../Clients/ObservableFollowersClient.cs | 28 +- .../Clients/ObservableGistCommentsClient.cs | 12 +- .../Clients/ObservableGistsClient.cs | 50 ++-- .../ObservableIssueCommentReactionsClient.cs | 14 +- .../Clients/ObservableIssueCommentsClient.cs | 70 ++--- .../Clients/ObservableIssueReactionsClient.cs | 14 +- .../Clients/ObservableIssueTimelineClient.cs | 14 +- .../Clients/ObservableIssuesClient.cs | 94 +++--- .../Clients/ObservableIssuesEventsClient.cs | 30 +- .../Clients/ObservableIssuesLabelsClient.cs | 102 +++---- .../Clients/ObservableMergingClient.cs | 10 +- .../Clients/ObservableMigrationClient.cs | 2 +- .../Clients/ObservableMigrationsClient.cs | 2 +- .../Clients/ObservableMilestonesClient.cs | 58 ++-- .../Clients/ObservableMiscellaneousClient.cs | 2 +- .../Clients/ObservableNotificationsClient.cs | 58 ++-- .../Clients/ObservableOauthClient.cs | 2 +- .../ObservableOrganizationMembersClient.cs | 52 ++-- .../Clients/ObservableOrganizationsClient.cs | 24 +- .../Clients/ObservableProjectCardsClient.cs | 10 +- .../Clients/ObservableProjectColumnsClient.cs | 10 +- .../Clients/ObservableProjectsClient.cs | 40 +-- ...PullRequestReviewCommentReactionsClient.cs | 14 +- ...servablePullRequestReviewCommentsClient.cs | 78 ++--- ...servablePullRequestReviewRequestsClient.cs | 30 +- .../Clients/ObservablePullRequestsClient.cs | 74 ++--- .../Clients/ObservableReactionsClient.cs | 2 +- .../Clients/ObservableReferencesClient.cs | 58 ++-- .../Clients/ObservableReleasesClient.cs | 78 ++--- .../ObservableRepoCollaboratorsClient.cs | 78 ++--- .../Clients/ObservableRepositoriesClient.cs | 98 +++---- .../ObservableRepositoryBranchesClient.cs | 274 +++++++++--------- .../ObservableRepositoryCommentsClient.cs | 62 ++-- .../ObservableRepositoryCommitsClients.cs | 58 ++-- .../ObservableRepositoryContentsClient.cs | 106 +++---- .../ObservableRepositoryDeployKeysClient.cs | 30 +- .../ObservableRepositoryForksClient.cs | 42 +-- .../ObservableRepositoryHooksClient.cs | 46 +-- .../ObservableRepositoryInvitationsClient.cs | 8 +- .../ObservableRepositoryPagesClient.cs | 26 +- .../ObservableRepositoryTrafficClient.cs | 26 +- .../Clients/ObservableSearchClient.cs | 10 +- .../Clients/ObservableStarredClient.cs | 86 +++--- .../Clients/ObservableStatisticsClient.cs | 22 +- .../Clients/ObservableTagsClient.cs | 18 +- .../Clients/ObservableTeamsClient.cs | 46 +-- .../Clients/ObservableTreesClient.cs | 26 +- .../ObservableUserAdministrationClient.cs | 2 +- .../Clients/ObservableUserEmailsClient.cs | 4 +- .../Clients/ObservableUserGpgKeysClient.cs | 4 +- .../Clients/ObservableUserKeysClient.cs | 12 +- .../Clients/ObservableUsersClient.cs | 6 +- .../Clients/ObservableWatchedClient.cs | 38 +-- .../Helpers/AuthorizationExtensions.cs | 16 +- Octokit.Reactive/ObservableGitHubClient.cs | 2 +- Octokit/Authentication/Authenticator.cs | 4 +- Octokit/Authentication/BasicAuthenticator.cs | 6 +- Octokit/Authentication/TokenAuthenticator.cs | 6 +- Octokit/Clients/ApiClient.cs | 2 +- Octokit/Clients/ApiPagination.cs | 2 +- Octokit/Clients/AssigneesClient.cs | 32 +- Octokit/Clients/AuthorizationsClient.cs | 50 ++-- Octokit/Clients/BlobsClient.cs | 16 +- .../Clients/CommitCommentReactionsClient.cs | 12 +- Octokit/Clients/CommitStatusClient.cs | 40 +-- Octokit/Clients/CommitsClient.cs | 16 +- Octokit/Clients/DeploymentStatusClient.cs | 20 +- Octokit/Clients/DeploymentsClient.cs | 20 +- .../Enterprise/EnterpriseLdapClient.cs | 12 +- .../EnterpriseOrganizationClient.cs | 2 +- Octokit/Clients/Enterprise/EnterpriseProbe.cs | 4 +- .../EnterpriseSearchIndexingClient.cs | 20 +- Octokit/Clients/EventsClient.cs | 76 ++--- Octokit/Clients/FollowersClient.cs | 26 +- Octokit/Clients/GistCommentsClient.cs | 10 +- Octokit/Clients/GistsClient.cs | 50 ++-- .../Clients/IssueCommentReactionsClient.cs | 12 +- Octokit/Clients/IssueCommentsClient.cs | 68 ++--- Octokit/Clients/IssueReactionsClient.cs | 12 +- Octokit/Clients/IssueTimelineClient.cs | 12 +- Octokit/Clients/IssuesClient.cs | 92 +++--- Octokit/Clients/IssuesEventsClient.cs | 28 +- Octokit/Clients/IssuesLabelsClient.cs | 100 +++---- Octokit/Clients/MergingClient.cs | 8 +- Octokit/Clients/MigrationsClient.cs | 16 +- Octokit/Clients/MilestonesClient.cs | 56 ++-- Octokit/Clients/MiscellaneousClient.cs | 4 +- Octokit/Clients/NotificationsClient.cs | 56 ++-- Octokit/Clients/OAuthClient.cs | 6 +- Octokit/Clients/OrganizationMembersClient.cs | 50 ++-- Octokit/Clients/OrganizationsClient.cs | 22 +- Octokit/Clients/ProjectCardsClient.cs | 8 +- Octokit/Clients/ProjectColumnsClient.cs | 8 +- Octokit/Clients/ProjectsClient.cs | 43 +-- ...PullRequestReviewCommentReactionsClient.cs | 12 +- .../PullRequestReviewCommentsClient.cs | 76 ++--- .../PullRequestReviewRequestsClient.cs | 28 +- Octokit/Clients/ReferencesClient.cs | 56 ++-- Octokit/Clients/ReleasesClient.cs | 72 ++--- Octokit/Clients/RepoCollaboratorsClient.cs | 72 ++--- Octokit/Clients/RepositoriesClient.cs | 98 +++---- Octokit/Clients/RepositoryBranchesClient.cs | 272 ++++++++--------- Octokit/Clients/RepositoryCommentsClient.cs | 60 ++-- Octokit/Clients/RepositoryCommitsClient.cs | 56 ++-- Octokit/Clients/RepositoryContentsClient.cs | 104 +++---- Octokit/Clients/RepositoryDeployKeysClient.cs | 28 +- Octokit/Clients/RepositoryForksClient.cs | 40 +-- Octokit/Clients/RepositoryHooksClient.cs | 44 +-- .../Clients/RepositoryInvitationsClient.cs | 6 +- Octokit/Clients/RepositoryPagesClient.cs | 24 +- Octokit/Clients/RepositoryTrafficClient.cs | 24 +- Octokit/Clients/SearchClient.cs | 8 +- Octokit/Clients/StarredClient.cs | 84 +++--- Octokit/Clients/StatisticsClient.cs | 40 +-- Octokit/Clients/TagsClient.cs | 16 +- Octokit/Clients/TeamsClient.cs | 38 +-- Octokit/Clients/TreesClient.cs | 24 +- Octokit/Clients/UserAdministrationClient.cs | 24 +- Octokit/Clients/UserEmailsClient.cs | 6 +- Octokit/Clients/UserGpgKeysClient.cs | 4 +- Octokit/Clients/UserKeysClient.cs | 10 +- Octokit/Clients/UsersClient.cs | 4 +- Octokit/Clients/WatchedClient.cs | 36 +-- Octokit/Exceptions/ApiException.cs | 6 +- .../Exceptions/RateLimitExceededException.cs | 2 +- .../Exceptions/RepositoryExistsException.cs | 8 +- Octokit/GitHubClient.cs | 6 +- Octokit/Helpers/ApiExtensions.cs | 22 +- Octokit/Helpers/ApiUrls.cs | 12 +- Octokit/Helpers/CollectionExtensions.cs | 2 +- Octokit/Helpers/HttpClientExtensions.cs | 4 +- Octokit/Helpers/ReferenceExtensions.cs | 14 +- Octokit/Helpers/StringExtensions.cs | 10 +- Octokit/Helpers/TwoFactorChallengeResult.cs | 2 +- Octokit/Helpers/UriExtensions.cs | 2 +- Octokit/Http/ApiConnection.cs | 104 +++---- Octokit/Http/ApiInfo.cs | 6 +- Octokit/Http/ApiInfoExtensions.cs | 8 +- Octokit/Http/ApiInfoParser.cs | 2 +- Octokit/Http/ApiResponse.cs | 2 +- Octokit/Http/Connection.cs | 88 +++--- Octokit/Http/Credentials.cs | 6 +- Octokit/Http/CredentialsExtensions.cs | 2 +- Octokit/Http/HttpClientAdapter.cs | 8 +- Octokit/Http/InMemoryCredentialStore.cs | 2 +- Octokit/Http/JsonHttpPipeline.cs | 6 +- Octokit/Http/RateLimit.cs | 12 +- Octokit/Http/ReadOnlyPagedCollection.cs | 4 +- Octokit/Http/Response.cs | 4 +- Octokit/Http/SimpleJsonSerializer.cs | 2 +- Octokit/Models/Request/BaseSearchRequest.cs | 2 +- .../Models/Request/BranchProtectionUpdate.cs | 16 +- Octokit/Models/Request/CreateFileRequest.cs | 16 +- .../Request/DraftPullRequestReviewComment.cs | 4 +- .../Request/Enterprise/NewLdapMapping.cs | 2 +- Octokit/Models/Request/LabelUpdate.cs | 4 +- Octokit/Models/Request/NewCommitComment.cs | 2 +- Octokit/Models/Request/NewGpgKey.cs | 2 +- Octokit/Models/Request/NewLabel.cs | 4 +- Octokit/Models/Request/NewMerge.cs | 4 +- Octokit/Models/Request/NewMilestone.cs | 2 +- Octokit/Models/Request/NewPublicKey.cs | 4 +- Octokit/Models/Request/NewPullRequest.cs | 6 +- Octokit/Models/Request/NewReference.cs | 4 +- Octokit/Models/Request/NewRelease.cs | 2 +- Octokit/Models/Request/NewRepository.cs | 2 +- .../Models/Request/NewRepositoryWebHook.cs | 2 +- Octokit/Models/Request/NewUser.cs | 4 +- Octokit/Models/Request/OauthLoginRequest.cs | 2 +- Octokit/Models/Request/OauthTokenRequest.cs | 6 +- Octokit/Models/Request/OrganizationRequest.cs | 2 +- Octokit/Models/Request/ProjectCardMove.cs | 2 +- Octokit/Models/Request/ProjectColumnMove.cs | 2 +- .../Request/PullRequestReviewCommentCreate.cs | 6 +- .../Request/PullRequestReviewCommentEdit.cs | 2 +- .../PullRequestReviewCommentReplyCreate.cs | 2 +- Octokit/Models/Request/ReferenceUpdate.cs | 2 +- Octokit/Models/Request/ReleaseAssetUpdate.cs | 2 +- Octokit/Models/Request/RepositoryUpdate.cs | 2 +- Octokit/Models/Request/SearchCodeRequest.cs | 4 +- Octokit/Models/Request/SearchIssuesRequest.cs | 4 +- Octokit/Models/Request/Signature.cs | 4 +- Octokit/Models/Request/UserRename.cs | 2 +- .../Models/Response/AdditionsAndDeletions.cs | 2 +- Octokit/Models/Response/CodeFrequency.cs | 4 +- Octokit/Models/Response/Commit.cs | 2 +- Octokit/Models/Response/CommitActivity.cs | 2 +- Octokit/Models/Response/Emoji.cs | 4 +- Octokit/Models/Response/GitIgnoreTemplate.cs | 4 +- Octokit/Models/Response/License.cs | 16 +- Octokit/Models/Response/LicenseMetadata.cs | 8 +- Octokit/Models/Response/Merge.cs | 2 +- .../Models/Response/MiscellaneousRateLimit.cs | 4 +- Octokit/Models/Response/Participation.cs | 4 +- Octokit/Models/Response/PullRequestCommit.cs | 2 +- Octokit/Models/Response/PunchCard.cs | 2 +- Octokit/Models/Response/PunchCardPoint.cs | 2 +- Octokit/Models/Response/Readme.cs | 4 +- .../Response/RepositoryContentLicense.cs | 2 +- Octokit/Models/Response/ResourceRateLimit.cs | 4 +- .../Models/Response/WeeklyCommitActivity.cs | 2 +- 218 files changed, 2707 insertions(+), 2706 deletions(-) diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseAdminStatsClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseAdminStatsClient.cs index 1ae1f61682..0de02bff46 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseAdminStatsClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseAdminStatsClient.cs @@ -15,7 +15,7 @@ public class ObservableEnterpriseAdminStatsClient : IObservableEnterpriseAdminSt public ObservableEnterpriseAdminStatsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.AdminStats; } diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs index a463212a72..25ba9c2263 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs @@ -10,7 +10,7 @@ public class ObservableEnterpriseClient : IObservableEnterpriseClient { public ObservableEnterpriseClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); AdminStats = new ObservableEnterpriseAdminStatsClient(client); Ldap = new ObservableEnterpriseLdapClient(client); diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs index d8ed988345..b6fb718455 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLdapClient.cs @@ -17,7 +17,7 @@ public class ObservableEnterpriseLdapClient : IObservableEnterpriseLdapClient public ObservableEnterpriseLdapClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.Ldap; } diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLicenseClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLicenseClient.cs index 3fbe664448..d3ca1e8e1b 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLicenseClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseLicenseClient.cs @@ -16,7 +16,7 @@ public class ObservableEnterpriseLicenseClient : IObservableEnterpriseLicenseCli public ObservableEnterpriseLicenseClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.License; } diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseOrganizationClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseOrganizationClient.cs index bf064920d6..6beaf279de 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseOrganizationClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseOrganizationClient.cs @@ -16,7 +16,7 @@ public class ObservableEnterpriseOrganizationClient : IObservableEnterpriseOrgan public ObservableEnterpriseOrganizationClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.Organization; } diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs index feb093db73..974f66638b 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs @@ -16,7 +16,7 @@ public class ObservableEnterpriseSearchIndexingClient : IObservableEnterpriseSea public ObservableEnterpriseSearchIndexingClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Enterprise.SearchIndexing; } diff --git a/Octokit.Reactive/Clients/ObservableActivitiesClient.cs b/Octokit.Reactive/Clients/ObservableActivitiesClient.cs index bf5213544e..edef1eed53 100644 --- a/Octokit.Reactive/Clients/ObservableActivitiesClient.cs +++ b/Octokit.Reactive/Clients/ObservableActivitiesClient.cs @@ -4,7 +4,7 @@ public class ObservableActivitiesClient : IObservableActivitiesClient { public ObservableActivitiesClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); Events = new ObservableEventsClient(client); Watching = new ObservableWatchedClient(client); diff --git a/Octokit.Reactive/Clients/ObservableAssigneesClient.cs b/Octokit.Reactive/Clients/ObservableAssigneesClient.cs index eb242d635b..39c45f29ad 100644 --- a/Octokit.Reactive/Clients/ObservableAssigneesClient.cs +++ b/Octokit.Reactive/Clients/ObservableAssigneesClient.cs @@ -17,7 +17,7 @@ public class ObservableAssigneesClient : IObservableAssigneesClient public ObservableAssigneesClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Issue.Assignee; _connection = client.Connection; @@ -30,8 +30,8 @@ public ObservableAssigneesClient(IGitHubClient client) /// The name of the repository public IObservable GetAllForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepository(owner, name, ApiOptions.None); } @@ -53,9 +53,9 @@ public IObservable GetAllForRepository(long repositoryId) /// The options to change API's behaviour. public IObservable GetAllForRepository(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 _connection.GetAndFlattenAllPages(ApiUrls.Assignees(owner, name), options); } @@ -67,7 +67,7 @@ public IObservable GetAllForRepository(string owner, string name, ApiOptio /// The options to change API's behaviour. public IObservable GetAllForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Assignees(repositoryId), options); } @@ -80,9 +80,9 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptions optio /// Username of the prospective assignee public IObservable CheckAssignee(string owner, string name, string assignee) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(assignee, "assignee"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(assignee, nameof(assignee)); return _client.CheckAssignee(owner, name, assignee).ToObservable(); } @@ -96,9 +96,9 @@ public IObservable CheckAssignee(string owner, string name, string assigne /// List of names of assignees to add public IObservable AddAssignees(string owner, string name, int number, AssigneesUpdate assignees) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(assignees, "assignees"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(assignees, nameof(assignees)); return _client.AddAssignees(owner, name, number, assignees).ToObservable(); } @@ -113,9 +113,9 @@ public IObservable AddAssignees(string owner, string name, int number, As /// public IObservable RemoveAssignees(string owner, string name, int number, AssigneesUpdate assignees) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(assignees, "assignees"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(assignees, nameof(assignees)); return _client.RemoveAssignees(owner, name, number, assignees).ToObservable(); } @@ -127,7 +127,7 @@ public IObservable RemoveAssignees(string owner, string name, int number, /// Username of the prospective assignee public IObservable CheckAssignee(long repositoryId, string assignee) { - Ensure.ArgumentNotNullOrEmptyString(assignee, "assignee"); + Ensure.ArgumentNotNullOrEmptyString(assignee, nameof(assignee)); return _client.CheckAssignee(repositoryId, assignee).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs index e63ac304c7..7da86509db 100644 --- a/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableAuthorizationsClient.cs @@ -12,7 +12,7 @@ public class ObservableAuthorizationsClient : IObservableAuthorizationsClient public ObservableAuthorizationsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Authorization; _connection = client.Connection; @@ -42,7 +42,7 @@ public IObservable GetAll() /// A list of s for the authenticated user. public IObservable GetAll(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Authorizations(), options); } @@ -79,7 +79,7 @@ public IObservable Get(int id) /// The created . public IObservable Create(NewAuthorization newAuthorization) { - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); return _client.Create(newAuthorization).ToObservable(); } @@ -105,8 +105,8 @@ public IObservable Create( NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); - Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); + Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, nameof(twoFactorAuthenticationCode)); return _client.Create(newAuthorization, twoFactorAuthenticationCode).ToObservable(); } @@ -135,9 +135,9 @@ public IObservable Create( string clientSecret, NewAuthorization newAuthorization) { - Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); - Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); + Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); + Ensure.ArgumentNotNullOrEmptyString(clientSecret, nameof(clientSecret)); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); return _client.Create(clientId, clientSecret, newAuthorization).ToObservable(); } @@ -168,10 +168,10 @@ public IObservable Create( NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { - Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); - Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); - Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); + Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); + Ensure.ArgumentNotNullOrEmptyString(clientSecret, nameof(clientSecret)); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); + Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, nameof(twoFactorAuthenticationCode)); return _client.Create(clientId, clientSecret, newAuthorization, twoFactorAuthenticationCode).ToObservable(); } @@ -198,9 +198,9 @@ public IObservable GetOrCreateApplicationAuthenticatio string clientSecret, NewAuthorization newAuthorization) { - Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); - Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); + Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); + Ensure.ArgumentNotNullOrEmptyString(clientSecret, nameof(clientSecret)); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); return _client.GetOrCreateApplicationAuthentication(clientId, clientSecret, newAuthorization) .ToObservable(); @@ -230,10 +230,10 @@ public IObservable GetOrCreateApplicationAuthenticatio NewAuthorization newAuthorization, string twoFactorAuthenticationCode) { - Ensure.ArgumentNotNullOrEmptyString(clientId, "clientId"); - Ensure.ArgumentNotNullOrEmptyString(clientSecret, "clientSecret"); - Ensure.ArgumentNotNull(newAuthorization, "newAuthorization"); - Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, "twoFactorAuthenticationCode"); + Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); + Ensure.ArgumentNotNullOrEmptyString(clientSecret, nameof(clientSecret)); + Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); + Ensure.ArgumentNotNullOrEmptyString(twoFactorAuthenticationCode, nameof(twoFactorAuthenticationCode)); return _client.GetOrCreateApplicationAuthentication( clientId, @@ -309,7 +309,7 @@ public IObservable RevokeApplicationAuthentication(string clientId, string /// public IObservable Update(int id, AuthorizationUpdate authorizationUpdate) { - Ensure.ArgumentNotNull(authorizationUpdate, "authorizationUpdate"); + Ensure.ArgumentNotNull(authorizationUpdate, nameof(authorizationUpdate)); return _client.Update(id, authorizationUpdate).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableBlobClient.cs b/Octokit.Reactive/Clients/ObservableBlobClient.cs index e2ebac25d3..8c52e2555b 100644 --- a/Octokit.Reactive/Clients/ObservableBlobClient.cs +++ b/Octokit.Reactive/Clients/ObservableBlobClient.cs @@ -15,7 +15,7 @@ public class ObservableBlobClient : IObservableBlobsClient public ObservableBlobClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Git.Blob; } @@ -31,9 +31,9 @@ public ObservableBlobClient(IGitHubClient client) /// The SHA of the blob public IObservable Get(string owner, string name, string reference) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.Get(owner, name, reference).ToObservable(); } @@ -48,7 +48,7 @@ public IObservable Get(string owner, string name, string reference) /// The SHA of the blob public IObservable Get(long repositoryId, string reference) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.Get(repositoryId, reference).ToObservable(); } @@ -64,9 +64,9 @@ public IObservable Get(long repositoryId, string reference) /// The new Blob public IObservable Create(string owner, string name, NewBlob newBlob) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(newBlob, "newBlob"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(newBlob, nameof(newBlob)); return _client.Create(owner, name, newBlob).ToObservable(); } @@ -81,7 +81,7 @@ public IObservable Create(string owner, string name, NewBlob newB /// The new Blob public IObservable Create(long repositoryId, NewBlob newBlob) { - Ensure.ArgumentNotNull(newBlob, "newBlob"); + Ensure.ArgumentNotNull(newBlob, nameof(newBlob)); return _client.Create(repositoryId, newBlob).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index 5c7e965c4d..c17c50057c 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -17,7 +17,7 @@ public class ObservableCommitCommentReactionsClient : IObservableCommitCommentRe public ObservableCommitCommentReactionsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Reaction.CommitComment; _connection = client.Connection; @@ -34,9 +34,9 @@ public ObservableCommitCommentReactionsClient(IGitHubClient client) /// public IObservable Create(string owner, string name, int number, NewReaction reaction) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(owner, name, number, reaction).ToObservable(); } @@ -51,7 +51,7 @@ public IObservable Create(string owner, string name, int number, NewRe /// public IObservable Create(long repositoryId, int number, NewReaction reaction) { - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(repositoryId, number, reaction).ToObservable(); } @@ -66,8 +66,8 @@ public IObservable Create(long repositoryId, int number, NewReaction r /// public IObservable GetAll(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 _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview); } diff --git a/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs b/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs index 8cf0fc04d4..a8a4784abc 100644 --- a/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs @@ -17,7 +17,7 @@ public class ObservableCommitStatusClient : IObservableCommitStatusClient public ObservableCommitStatusClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Repository.Status; _connection = client.Connection; @@ -33,9 +33,9 @@ public ObservableCommitStatusClient(IGitHubClient client) /// The reference (SHA, branch name, or tag name) to list commits for public IObservable GetAll(string owner, string name, string reference) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return GetAll(owner, name, reference, ApiOptions.None); } @@ -49,7 +49,7 @@ public IObservable GetAll(string owner, string name, string refere /// The reference (SHA, branch name, or tag name) to list commits for public IObservable GetAll(long repositoryId, string reference) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return GetAll(repositoryId, reference, ApiOptions.None); } @@ -65,10 +65,10 @@ public IObservable GetAll(long repositoryId, string reference) /// Options for changing the API response public IObservable GetAll(string owner, string name, string reference, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.CommitStatuses(owner, name, reference), options); } @@ -83,8 +83,8 @@ public IObservable GetAll(string owner, string name, string refere /// Options for changing the API response public IObservable GetAll(long repositoryId, string reference, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.CommitStatuses(repositoryId, reference), options); } @@ -99,9 +99,9 @@ public IObservable GetAll(long repositoryId, string reference, Api /// The reference (SHA, branch name, or tag name) to list commits for public IObservable GetCombined(string owner, string name, string reference) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.GetCombined(owner, name, reference).ToObservable(); } @@ -115,7 +115,7 @@ public IObservable GetCombined(string owner, string name, /// The reference (SHA, branch name, or tag name) to list commits for public IObservable GetCombined(long repositoryId, string reference) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.GetCombined(repositoryId, reference).ToObservable(); } @@ -129,10 +129,10 @@ public IObservable GetCombined(long repositoryId, string r /// The commit status to create public IObservable Create(string owner, string name, string reference, NewCommitStatus newCommitStatus) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); + Ensure.ArgumentNotNull(newCommitStatus, nameof(newCommitStatus)); return _client.Create(owner, name, reference, newCommitStatus).ToObservable(); } @@ -145,8 +145,8 @@ public IObservable Create(string owner, string name, string refere /// The commit status to create public IObservable Create(long repositoryId, string reference, NewCommitStatus newCommitStatus) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); + Ensure.ArgumentNotNull(newCommitStatus, nameof(newCommitStatus)); return _client.Create(repositoryId, reference, newCommitStatus).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableCommitsClient.cs b/Octokit.Reactive/Clients/ObservableCommitsClient.cs index ff7bfc8573..2fb1e232cc 100644 --- a/Octokit.Reactive/Clients/ObservableCommitsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitsClient.cs @@ -15,7 +15,7 @@ public class ObservableCommitsClient : IObservableCommitsClient public ObservableCommitsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Git.Commit; } @@ -31,9 +31,9 @@ public ObservableCommitsClient(IGitHubClient client) /// Tha sha reference of the commit public IObservable Get(string owner, string name, string reference) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.Get(owner, name, reference).ToObservable(); } @@ -48,7 +48,7 @@ public IObservable Get(string owner, string name, string reference) /// Tha sha reference of the commit public IObservable Get(long repositoryId, string reference) { - Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); return _client.Get(repositoryId, reference).ToObservable(); } @@ -64,9 +64,9 @@ public IObservable Get(long repositoryId, string reference) /// The commit to create public IObservable Create(string owner, string name, NewCommit commit) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(commit, "commit"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(commit, nameof(commit)); return _client.Create(owner, name, commit).ToObservable(); } @@ -81,7 +81,7 @@ public IObservable Create(string owner, string name, NewCommit commit) /// The commit to create public IObservable Create(long repositoryId, NewCommit commit) { - Ensure.ArgumentNotNull(commit, "commit"); + Ensure.ArgumentNotNull(commit, nameof(commit)); return _client.Create(repositoryId, commit).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs index 964fa8db7b..e9ec0425ff 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs @@ -18,7 +18,7 @@ public class ObservableDeploymentStatusClient : IObservableDeploymentStatusClien public ObservableDeploymentStatusClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Repository.Deployment.Status; _connection = client.Connection; @@ -36,8 +36,8 @@ public ObservableDeploymentStatusClient(IGitHubClient client) /// The id of the deployment. public IObservable GetAll(string owner, string name, int deploymentId) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAll(owner, name, deploymentId, ApiOptions.None); } @@ -69,9 +69,9 @@ public IObservable GetAll(long repositoryId, int deploymentId) /// Options for changing the API response public IObservable GetAll(string owner, string name, int deploymentId, 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 _connection.GetAndFlattenAllPages( ApiUrls.DeploymentStatuses(owner, name, deploymentId), options); @@ -89,7 +89,7 @@ public IObservable GetAll(string owner, string name, int deplo /// Options for changing the API response public IObservable GetAll(long repositoryId, int deploymentId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages( ApiUrls.DeploymentStatuses(repositoryId, deploymentId), options); @@ -108,9 +108,9 @@ public IObservable GetAll(long repositoryId, int deploymentId, /// The new deployment status to create. public IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus)); return _client.Create(owner, name, deploymentId, newDeploymentStatus).ToObservable(); } @@ -127,7 +127,7 @@ public IObservable Create(string owner, string name, int deplo /// The new deployment status to create. public IObservable Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { - Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); + Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus)); return _client.Create(repositoryId, deploymentId, newDeploymentStatus).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableDeploymentsClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentsClient.cs index a0f0686805..3ba4fcf986 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentsClient.cs @@ -18,7 +18,7 @@ public class ObservableDeploymentsClient : IObservableDeploymentsClient public ObservableDeploymentsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Repository.Deployment; _connection = client.Connection; @@ -37,8 +37,8 @@ public ObservableDeploymentsClient(IGitHubClient client) /// The name of the repository public IObservable 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); } @@ -68,9 +68,9 @@ public IObservable GetAll(long repositoryId) /// Options for changing the API response public IObservable 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 _connection.GetAndFlattenAllPages( ApiUrls.Deployments(owner, name), options); @@ -87,7 +87,7 @@ public IObservable GetAll(string owner, string name, ApiOptions opti /// Options for changing the API response public IObservable GetAll(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages( ApiUrls.Deployments(repositoryId), options); @@ -105,7 +105,7 @@ public IObservable GetAll(long repositoryId, ApiOptions options) /// A instance describing the new deployment to create public IObservable Create(string owner, string name, NewDeployment newDeployment) { - Ensure.ArgumentNotNull(newDeployment, "newDeployment"); + Ensure.ArgumentNotNull(newDeployment, nameof(newDeployment)); return _client.Create(owner, name, newDeployment).ToObservable(); } @@ -121,7 +121,7 @@ public IObservable Create(string owner, string name, NewDeployment n /// A instance describing the new deployment to create public IObservable Create(long repositoryId, NewDeployment newDeployment) { - Ensure.ArgumentNotNull(newDeployment, "newDeployment"); + Ensure.ArgumentNotNull(newDeployment, nameof(newDeployment)); return _client.Create(repositoryId, newDeployment).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableEventsClient.cs b/Octokit.Reactive/Clients/ObservableEventsClient.cs index 666fc8c1d1..1f6f436b62 100644 --- a/Octokit.Reactive/Clients/ObservableEventsClient.cs +++ b/Octokit.Reactive/Clients/ObservableEventsClient.cs @@ -15,7 +15,7 @@ public class ObservableEventsClient : IObservableEventsClient public ObservableEventsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _connection = client.Connection; } @@ -40,7 +40,7 @@ public IObservable GetAll() /// Options for changing the API response public IObservable GetAll(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Events(), options); } @@ -55,8 +55,8 @@ public IObservable GetAll(ApiOptions options) /// The name of the repository public IObservable GetAllForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepository(owner, name, ApiOptions.None); } @@ -84,9 +84,9 @@ public IObservable GetAllForRepository(long repositoryId) /// Options for changing the API response public IObservable GetAllForRepository(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 _connection.GetAndFlattenAllPages(ApiUrls.Events(owner, name), options); } @@ -101,7 +101,7 @@ public IObservable GetAllForRepository(string owner, string name, ApiO /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Events(repositoryId), options); } @@ -116,8 +116,8 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptions o /// The name of the repository public IObservable GetAllIssuesForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllIssuesForRepository(owner, name, ApiOptions.None); } @@ -145,9 +145,9 @@ public IObservable GetAllIssuesForRepository(long repositoryId) /// Options for changing the API response public IObservable GetAllIssuesForRepository(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 _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(owner, name), options); } @@ -162,7 +162,7 @@ public IObservable GetAllIssuesForRepository(string owner, string na /// Options for changing the API response public IObservable GetAllIssuesForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(repositoryId), options); } @@ -177,8 +177,8 @@ public IObservable GetAllIssuesForRepository(long repositoryId, ApiO /// The name of the repository public IObservable GetAllForRepositoryNetwork(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepositoryNetwork(owner, name, ApiOptions.None); } @@ -194,9 +194,9 @@ public IObservable GetAllForRepositoryNetwork(string owner, string nam /// Options for changing the API response public IObservable GetAllForRepositoryNetwork(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 _connection.GetAndFlattenAllPages(ApiUrls.NetworkEvents(owner, name), options); } @@ -210,7 +210,7 @@ public IObservable GetAllForRepositoryNetwork(string owner, string nam /// The name of the organization public IObservable GetAllForOrganization(string organization) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); return GetAllForOrganization(organization, ApiOptions.None); } @@ -225,8 +225,8 @@ public IObservable GetAllForOrganization(string organization) /// Options for changing the API response public IObservable GetAllForOrganization(string organization, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.OrganizationEvents(organization), options); } @@ -240,7 +240,7 @@ public IObservable GetAllForOrganization(string organization, ApiOptio /// The login of the user public IObservable GetAllUserReceived(string user) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllUserReceived(user, ApiOptions.None); } @@ -255,8 +255,8 @@ public IObservable GetAllUserReceived(string user) /// Options for changing the API response public IObservable GetAllUserReceived(string user, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.ReceivedEvents(user), options); } @@ -270,7 +270,7 @@ public IObservable GetAllUserReceived(string user, ApiOptions options) /// The login of the user public IObservable GetAllUserReceivedPublic(string user) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllUserReceivedPublic(user, ApiOptions.None); } @@ -285,8 +285,8 @@ public IObservable GetAllUserReceivedPublic(string user) /// Options for changing the API response public IObservable GetAllUserReceivedPublic(string user, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.ReceivedEvents(user, true), options); } @@ -300,7 +300,7 @@ public IObservable GetAllUserReceivedPublic(string user, ApiOptions op /// The login of the user public IObservable GetAllUserPerformed(string user) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllUserPerformed(user, ApiOptions.None); } @@ -315,8 +315,8 @@ public IObservable GetAllUserPerformed(string user) /// Options for changing the API response public IObservable GetAllUserPerformed(string user, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PerformedEvents(user), options); } @@ -330,7 +330,7 @@ public IObservable GetAllUserPerformed(string user, ApiOptions options /// The login of the user public IObservable GetAllUserPerformedPublic(string user) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllUserPerformedPublic(user, ApiOptions.None); } @@ -345,8 +345,8 @@ public IObservable GetAllUserPerformedPublic(string user) /// Options for changing the API response public IObservable GetAllUserPerformedPublic(string user, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PerformedEvents(user, true), options); } @@ -361,8 +361,8 @@ public IObservable GetAllUserPerformedPublic(string user, ApiOptions o /// The name of the organization public IObservable GetAllForAnOrganization(string user, string organization) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); return GetAllForAnOrganization(user, organization, ApiOptions.None); } @@ -378,9 +378,9 @@ public IObservable GetAllForAnOrganization(string user, string organiz /// Options for changing the API response public IObservable GetAllForAnOrganization(string user, string organization, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.OrganizationEvents(user, organization), options); } diff --git a/Octokit.Reactive/Clients/ObservableFeedsClient.cs b/Octokit.Reactive/Clients/ObservableFeedsClient.cs index 12f2f16667..1bea312fdb 100644 --- a/Octokit.Reactive/Clients/ObservableFeedsClient.cs +++ b/Octokit.Reactive/Clients/ObservableFeedsClient.cs @@ -15,7 +15,7 @@ public class ObservableFeedsClient : IObservableFeedsClient public ObservableFeedsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Activity.Feeds; } diff --git a/Octokit.Reactive/Clients/ObservableFollowersClient.cs b/Octokit.Reactive/Clients/ObservableFollowersClient.cs index 955b530927..b321c4f743 100644 --- a/Octokit.Reactive/Clients/ObservableFollowersClient.cs +++ b/Octokit.Reactive/Clients/ObservableFollowersClient.cs @@ -16,7 +16,7 @@ public class ObservableFollowersClient : IObservableFollowersClient /// An used to make the requests public ObservableFollowersClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.User.Followers; _connection = client.Connection; @@ -44,7 +44,7 @@ public IObservable GetAllForCurrent() /// A of s that follow the authenticated user. public IObservable GetAllForCurrent(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Followers(), options); } @@ -59,7 +59,7 @@ public IObservable GetAllForCurrent(ApiOptions options) /// A of s that follow the passed user. public IObservable GetAll(string login) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); return GetAll(login, ApiOptions.None); } @@ -75,8 +75,8 @@ public IObservable GetAll(string login) /// A of s that follow the passed user. public IObservable GetAll(string login, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Followers(login), options); } @@ -103,7 +103,7 @@ public IObservable GetAllFollowingForCurrent() /// A of s that the authenticated user follows. public IObservable GetAllFollowingForCurrent(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Following(), options); } @@ -118,7 +118,7 @@ public IObservable GetAllFollowingForCurrent(ApiOptions options) /// A of s that the passed user follows. public IObservable GetAllFollowing(string login) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); return GetAllFollowing(login, ApiOptions.None); } @@ -134,8 +134,8 @@ public IObservable GetAllFollowing(string login) /// A of s that the passed user follows. public IObservable GetAllFollowing(string login, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Following(login), options); } @@ -150,7 +150,7 @@ public IObservable GetAllFollowing(string login, ApiOptions options) /// A bool representing the success of the operation. public IObservable IsFollowingForCurrent(string following) { - Ensure.ArgumentNotNullOrEmptyString(following, "following"); + Ensure.ArgumentNotNullOrEmptyString(following, nameof(following)); return _client.IsFollowingForCurrent(following).ToObservable(); } @@ -166,8 +166,8 @@ public IObservable IsFollowingForCurrent(string following) /// A bool representing the success of the operation. public IObservable IsFollowing(string login, string following) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); - Ensure.ArgumentNotNullOrEmptyString(following, "following"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); + Ensure.ArgumentNotNullOrEmptyString(following, nameof(following)); return _client.IsFollowing(login, following).ToObservable(); } @@ -182,7 +182,7 @@ public IObservable IsFollowing(string login, string following) /// A bool representing the success of the operation. public IObservable Follow(string login) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); return _client.Follow(login).ToObservable(); } @@ -197,7 +197,7 @@ public IObservable Follow(string login) /// public IObservable Unfollow(string login) { - Ensure.ArgumentNotNullOrEmptyString(login, "login"); + Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); return _client.Unfollow(login).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs b/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs index 240dd6f3a8..ac16b247eb 100644 --- a/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGistCommentsClient.cs @@ -12,7 +12,7 @@ public class ObservableGistCommentsClient : IObservableGistCommentsClient public ObservableGistCommentsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Gist.Comment; _connection = client.Connection; @@ -38,7 +38,7 @@ public IObservable Get(string gistId, int commentId) /// IObservable{GistComment}. public IObservable GetAllForGist(string gistId) { - Ensure.ArgumentNotNullOrEmptyString(gistId, "gistId"); + Ensure.ArgumentNotNullOrEmptyString(gistId, nameof(gistId)); return GetAllForGist(gistId, ApiOptions.None); } @@ -52,8 +52,8 @@ public IObservable GetAllForGist(string gistId) /// IObservable{GistComment}. public IObservable GetAllForGist(string gistId, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(gistId, "gistId"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(gistId, nameof(gistId)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.GistComments(gistId), options); } @@ -67,7 +67,7 @@ public IObservable GetAllForGist(string gistId, ApiOptions options) /// IObservable{GistComment}. public IObservable Create(string gistId, string comment) { - Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); + Ensure.ArgumentNotNullOrEmptyString(comment, nameof(comment)); return _client.Create(gistId, comment).ToObservable(); } @@ -82,7 +82,7 @@ public IObservable Create(string gistId, string comment) /// IObservable{GistComment}. public IObservable Update(string gistId, int commentId, string comment) { - Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); + Ensure.ArgumentNotNullOrEmptyString(comment, nameof(comment)); return _client.Update(gistId, commentId, comment).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableGistsClient.cs b/Octokit.Reactive/Clients/ObservableGistsClient.cs index a76dd58d64..a97b0315c2 100644 --- a/Octokit.Reactive/Clients/ObservableGistsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGistsClient.cs @@ -12,7 +12,7 @@ public class ObservableGistsClient : IObservableGistsClient public ObservableGistsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Gist; _connection = client.Connection; @@ -30,7 +30,7 @@ public ObservableGistsClient(IGitHubClient client) /// The id of the gist public IObservable Get(string id) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); return _client.Get(id).ToObservable(); } @@ -44,7 +44,7 @@ public IObservable Get(string id) /// The new gist to create public IObservable Create(NewGist newGist) { - Ensure.ArgumentNotNull(newGist, "newGist"); + Ensure.ArgumentNotNull(newGist, nameof(newGist)); return _client.Create(newGist).ToObservable(); } @@ -70,7 +70,7 @@ public IObservable Fork(string id) /// The id of the gist public IObservable Delete(string id) { - Ensure.ArgumentNotNull(id, "id"); + Ensure.ArgumentNotNull(id, nameof(id)); return _client.Delete(id).ToObservable(); } @@ -97,7 +97,7 @@ public IObservable GetAll() /// Options for changing the API response public IObservable GetAll(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Gist(), options); } @@ -126,7 +126,7 @@ public IObservable GetAll(DateTimeOffset since) /// Options for changing the API response public IObservable GetAll(DateTimeOffset since, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); var request = new GistRequest(since); return _connection.GetAndFlattenAllPages(ApiUrls.Gist(), request.ToParametersDictionary(), options); @@ -152,7 +152,7 @@ public IObservable GetAllPublic() /// Options for changing the API response public IObservable GetAllPublic(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PublicGists(), options); } @@ -179,7 +179,7 @@ public IObservable GetAllPublic(DateTimeOffset since) /// Options for changing the API response public IObservable GetAllPublic(DateTimeOffset since, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); var request = new GistRequest(since); return _connection.GetAndFlattenAllPages(ApiUrls.PublicGists(), request.ToParametersDictionary(), options); @@ -205,7 +205,7 @@ public IObservable GetAllStarred() /// Options for changing the API response public IObservable GetAllStarred(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.StarredGists(), options); } @@ -232,7 +232,7 @@ public IObservable GetAllStarred(DateTimeOffset since) /// Options for changing the API response public IObservable GetAllStarred(DateTimeOffset since, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); var request = new GistRequest(since); return _connection.GetAndFlattenAllPages(ApiUrls.StarredGists(), request.ToParametersDictionary(), options); @@ -247,7 +247,7 @@ public IObservable GetAllStarred(DateTimeOffset since, ApiOptions options) /// The user public IObservable GetAllForUser(string user) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllForUser(user, ApiOptions.None); } @@ -262,8 +262,8 @@ public IObservable GetAllForUser(string user) /// Options for changing the API response public IObservable GetAllForUser(string user, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.UsersGists(user), options); } @@ -278,7 +278,7 @@ public IObservable GetAllForUser(string user, ApiOptions options) /// Only gists updated at or after this time are returned public IObservable GetAllForUser(string user, DateTimeOffset since) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return GetAllForUser(user, since, ApiOptions.None); } @@ -294,8 +294,8 @@ public IObservable GetAllForUser(string user, DateTimeOffset since) /// Options for changing the API response public IObservable GetAllForUser(string user, DateTimeOffset since, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(user, "user"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); + Ensure.ArgumentNotNull(options, nameof(options)); var request = new GistRequest(since); return _connection.GetAndFlattenAllPages(ApiUrls.UsersGists(user), request.ToParametersDictionary(), options); @@ -310,7 +310,7 @@ public IObservable GetAllForUser(string user, DateTimeOffset since, ApiOpt /// The id of the gist public IObservable GetAllCommits(string id) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); return GetAllCommits(id, ApiOptions.None); } @@ -325,8 +325,8 @@ public IObservable GetAllCommits(string id) /// Options for changing the API response public IObservable GetAllCommits(string id, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.GistCommits(id), options); } @@ -340,7 +340,7 @@ public IObservable GetAllCommits(string id, ApiOptions options) /// The id of the gist public IObservable GetAllForks(string id) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); return GetAllForks(id, ApiOptions.None); } @@ -355,8 +355,8 @@ public IObservable GetAllForks(string id) /// Options for changing the API response public IObservable GetAllForks(string id, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.ForkGist(id), options); } @@ -371,8 +371,8 @@ public IObservable GetAllForks(string id, ApiOptions options) /// The update to the gist public IObservable Edit(string id, GistUpdate gistUpdate) { - Ensure.ArgumentNotNull(id, "id"); - Ensure.ArgumentNotNull(gistUpdate, "gistUpdate"); + Ensure.ArgumentNotNull(id, nameof(id)); + Ensure.ArgumentNotNull(gistUpdate, nameof(gistUpdate)); return _client.Edit(id, gistUpdate).ToObservable(); } @@ -410,7 +410,7 @@ public IObservable Unstar(string id) /// The id of the gist public IObservable IsStarred(string id) { - Ensure.ArgumentNotNullOrEmptyString(id, "id"); + Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); return _client.IsStarred(id).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs index 5b62302dc7..641e709047 100644 --- a/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs @@ -17,7 +17,7 @@ public class ObservableIssueCommentReactionsClient : IObservableIssueCommentReac public ObservableIssueCommentReactionsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Reaction.IssueComment; _connection = client.Connection; @@ -33,9 +33,9 @@ public ObservableIssueCommentReactionsClient(IGitHubClient client) /// The reaction to create public IObservable Create(string owner, string name, int number, NewReaction reaction) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(owner, name, number, reaction).ToObservable(); } @@ -49,7 +49,7 @@ public IObservable Create(string owner, string name, int number, NewRe /// The reaction to create public IObservable Create(long repositoryId, int number, NewReaction reaction) { - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(repositoryId, number, reaction).ToObservable(); } @@ -63,8 +63,8 @@ public IObservable Create(long repositoryId, int number, NewReaction r /// The comment id public IObservable GetAll(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 _connection.GetAndFlattenAllPages(ApiUrls.IssueCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview); } diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs index 7069091cd1..5b21cedad9 100644 --- a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs @@ -18,7 +18,7 @@ public class ObservableIssueCommentsClient : IObservableIssueCommentsClient public ObservableIssueCommentsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Issue.Comment; _connection = client.Connection; @@ -33,8 +33,8 @@ public ObservableIssueCommentsClient(IGitHubClient client) /// The issue comment id public IObservable Get(string owner, string name, int id) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return _client.Get(owner, name, id).ToObservable(); } @@ -58,8 +58,8 @@ public IObservable Get(long repositoryId, int id) /// The name of the repository public IObservable GetAllForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepository(owner, name, ApiOptions.None); } @@ -83,9 +83,9 @@ public IObservable GetAllForRepository(long repositoryId) /// Options for changing the API response public IObservable GetAllForRepository(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 GetAllForRepository(owner, name, new IssueCommentRequest(), options); } @@ -98,7 +98,7 @@ public IObservable GetAllForRepository(string owner, string name, /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return GetAllForRepository(repositoryId, new IssueCommentRequest(), options); } @@ -112,9 +112,9 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptio /// The sorting parameters public IObservable GetAllForRepository(string owner, string name, IssueCommentRequest request) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForRepository(owner, name, request, ApiOptions.None); } @@ -127,7 +127,7 @@ public IObservable GetAllForRepository(string owner, string name, /// The sorting parameters public IObservable GetAllForRepository(long repositoryId, IssueCommentRequest request) { - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForRepository(repositoryId, request, ApiOptions.None); } @@ -142,10 +142,10 @@ public IObservable GetAllForRepository(long repositoryId, IssueCom /// Options for changing the API response public IObservable GetAllForRepository(string owner, string name, IssueCommentRequest request, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -159,8 +159,8 @@ public IObservable GetAllForRepository(string owner, string name, /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, IssueCommentRequest request, ApiOptions options) { - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -174,8 +174,8 @@ public IObservable GetAllForRepository(long repositoryId, IssueCom /// The issue number public IObservable GetAllForIssue(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 GetAllForIssue(owner, name, number, ApiOptions.None); } @@ -201,9 +201,9 @@ public IObservable GetAllForIssue(long repositoryId, int number) /// Options for changing the API response public IObservable GetAllForIssue(string owner, string name, int number, 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 _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); } @@ -217,7 +217,7 @@ public IObservable GetAllForIssue(string owner, string name, int n /// Options for changing the API response public IObservable GetAllForIssue(long repositoryId, int number, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId, number), options); } @@ -232,9 +232,9 @@ public IObservable GetAllForIssue(long repositoryId, int number, A /// The text of the new comment public IObservable Create(string owner, string name, int number, string newComment) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(newComment, "newComment"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(newComment, nameof(newComment)); return _client.Create(owner, name, number, newComment).ToObservable(); } @@ -248,7 +248,7 @@ public IObservable Create(string owner, string name, int number, s /// The text of the new comment public IObservable Create(long repositoryId, int number, string newComment) { - Ensure.ArgumentNotNull(newComment, "newComment"); + Ensure.ArgumentNotNull(newComment, nameof(newComment)); return _client.Create(repositoryId, number, newComment).ToObservable(); } @@ -263,9 +263,9 @@ public IObservable Create(long repositoryId, int number, string ne /// The modified comment public IObservable Update(string owner, string name, int id, string commentUpdate) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(commentUpdate, "commentUpdate"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate)); return _client.Update(owner, name, id, commentUpdate).ToObservable(); } @@ -279,7 +279,7 @@ public IObservable Update(string owner, string name, int id, strin /// The modified comment public IObservable Update(long repositoryId, int id, string commentUpdate) { - Ensure.ArgumentNotNull(commentUpdate, "commentUpdate"); + Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate)); return _client.Update(repositoryId, id, commentUpdate).ToObservable(); } @@ -293,8 +293,8 @@ public IObservable Update(long repositoryId, int id, string commen /// The comment id public IObservable Delete(string owner, string name, int id) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return _client.Delete(owner, name, id).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs b/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs index 95c09df5bc..6d2a3b154b 100644 --- a/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs @@ -17,7 +17,7 @@ public class ObservableIssueReactionsClient : IObservableIssueReactionsClient public ObservableIssueReactionsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Reaction.Issue; _connection = client.Connection; @@ -32,8 +32,8 @@ public ObservableIssueReactionsClient(IGitHubClient client) /// The issue id public IObservable GetAll(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 _connection.GetAndFlattenAllPages(ApiUrls.IssueReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview); } @@ -59,9 +59,9 @@ public IObservable GetAll(long repositoryId, int number) /// The reaction to create public IObservable Create(string owner, string name, int number, NewReaction reaction) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(owner, name, number, reaction).ToObservable(); } @@ -75,7 +75,7 @@ public IObservable Create(string owner, string name, int number, NewRe /// The reaction to create public IObservable Create(long repositoryId, int number, NewReaction reaction) { - Ensure.ArgumentNotNull(reaction, "reaction"); + Ensure.ArgumentNotNull(reaction, nameof(reaction)); return _client.Create(repositoryId, number, reaction).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs b/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs index 365752a638..efc0970157 100644 --- a/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs @@ -15,7 +15,7 @@ public class ObservableIssueTimelineClient : IObservableIssueTimelineClient public ObservableIssueTimelineClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _connection = client.Connection; } @@ -31,8 +31,8 @@ public ObservableIssueTimelineClient(IGitHubClient client) /// The issue number public IObservable GetAllForIssue(string owner, string repo, int number) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repo, "repo"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo)); return GetAllForIssue(owner, repo, number, ApiOptions.None); } @@ -49,9 +49,9 @@ public IObservable GetAllForIssue(string owner, string repo, /// Options for changing the API response public IObservable GetAllForIssue(string owner, string repo, int number, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repo, "repo"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(owner, repo, number), null, AcceptHeaders.IssueTimelineApiPreview, options); } @@ -80,7 +80,7 @@ public IObservable GetAllForIssue(long repositoryId, int numb /// Options for changing the API response public IObservable GetAllForIssue(long repositoryId, int number, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(repositoryId, number), null, AcceptHeaders.IssueTimelineApiPreview, options); } diff --git a/Octokit.Reactive/Clients/ObservableIssuesClient.cs b/Octokit.Reactive/Clients/ObservableIssuesClient.cs index 24b8b67ad5..fb38ed2134 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesClient.cs @@ -50,7 +50,7 @@ public class ObservableIssuesClient : IObservableIssuesClient public ObservableIssuesClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Issue; _connection = client.Connection; @@ -73,8 +73,8 @@ public ObservableIssuesClient(IGitHubClient client) /// The issue number public IObservable 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 _client.Get(owner, name, number).ToObservable(); } @@ -116,7 +116,7 @@ public IObservable GetAllForCurrent() /// public IObservable GetAllForCurrent(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return GetAllForCurrent(new IssueRequest(), options); } @@ -131,7 +131,7 @@ public IObservable GetAllForCurrent(ApiOptions options) /// Used to filter and sort the list of issues returned public IObservable GetAllForCurrent(IssueRequest request) { - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForCurrent(request, ApiOptions.None); } @@ -147,8 +147,8 @@ public IObservable GetAllForCurrent(IssueRequest request) /// Options for changing the API response public IObservable GetAllForCurrent(IssueRequest request, ApiOptions options) { - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Issues(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -177,7 +177,7 @@ public IObservable GetAllForOwnedAndMemberRepositories() /// Options for changing the API response public IObservable GetAllForOwnedAndMemberRepositories(ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return GetAllForOwnedAndMemberRepositories(new IssueRequest(), options); } @@ -191,7 +191,7 @@ public IObservable GetAllForOwnedAndMemberRepositories(ApiOptions options /// Used to filter and sort the list of issues returned public IObservable GetAllForOwnedAndMemberRepositories(IssueRequest request) { - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForOwnedAndMemberRepositories(request, ApiOptions.None); } @@ -206,8 +206,8 @@ public IObservable GetAllForOwnedAndMemberRepositories(IssueRequest reque /// Options for changing the API response public IObservable GetAllForOwnedAndMemberRepositories(IssueRequest request, ApiOptions options) { - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssuesForOwnedAndMember(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -221,7 +221,7 @@ public IObservable GetAllForOwnedAndMemberRepositories(IssueRequest reque /// The name of the organization public IObservable GetAllForOrganization(string organization) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); return GetAllForOrganization(organization, ApiOptions.None); } @@ -236,8 +236,8 @@ public IObservable GetAllForOrganization(string organization) /// Options for changing the API response public IObservable GetAllForOrganization(string organization, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); + Ensure.ArgumentNotNull(options, nameof(options)); return GetAllForOrganization(organization, new IssueRequest(), options); } @@ -252,8 +252,8 @@ public IObservable GetAllForOrganization(string organization, ApiOptions /// Used to filter and sort the list of issues returned public IObservable GetAllForOrganization(string organization, IssueRequest request) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForOrganization(organization, request, ApiOptions.None); } @@ -269,9 +269,9 @@ public IObservable GetAllForOrganization(string organization, IssueReques /// Options for changing the API response public IObservable GetAllForOrganization(string organization, IssueRequest request, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Issues(organization), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -286,8 +286,8 @@ public IObservable GetAllForOrganization(string organization, IssueReques /// The name of the repository public IObservable GetAllForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepository(owner, name, ApiOptions.None); } @@ -315,9 +315,9 @@ public IObservable GetAllForRepository(long repositoryId) /// Options for changing the API response public IObservable GetAllForRepository(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 GetAllForRepository(owner, name, new RepositoryIssueRequest(), options); } @@ -332,7 +332,7 @@ public IObservable GetAllForRepository(string owner, string name, ApiOpti /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options); } @@ -348,9 +348,9 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptions opti /// Used to filter and sort the list of issues returned public IObservable GetAllForRepository(string owner, string name, RepositoryIssueRequest request) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForRepository(owner, name, request, ApiOptions.None); } @@ -365,7 +365,7 @@ public IObservable GetAllForRepository(string owner, string name, Reposit /// Used to filter and sort the list of issues returned public IObservable GetAllForRepository(long repositoryId, RepositoryIssueRequest request) { - Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(request, nameof(request)); return GetAllForRepository(repositoryId, request, ApiOptions.None); } @@ -382,10 +382,10 @@ public IObservable GetAllForRepository(long repositoryId, RepositoryIssue /// Options for changing the API response public IObservable GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); } @@ -401,8 +401,8 @@ public IObservable GetAllForRepository(string owner, string name, Reposit /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, RepositoryIssueRequest request, ApiOptions options) { - Ensure.ArgumentNotNull(request, "request"); - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options); } @@ -417,9 +417,9 @@ public IObservable GetAllForRepository(long repositoryId, RepositoryIssue /// A instance describing the new issue to create public IObservable Create(string owner, string name, NewIssue newIssue) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(newIssue, "newIssue"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(newIssue, nameof(newIssue)); return _client.Create(owner, name, newIssue).ToObservable(); } @@ -433,7 +433,7 @@ public IObservable Create(string owner, string name, NewIssue newIssue) /// A instance describing the new issue to create public IObservable Create(long repositoryId, NewIssue newIssue) { - Ensure.ArgumentNotNull(newIssue, "newIssue"); + Ensure.ArgumentNotNull(newIssue, nameof(newIssue)); return _client.Create(repositoryId, newIssue).ToObservable(); } @@ -450,9 +450,9 @@ public IObservable Create(long repositoryId, NewIssue newIssue) /// public IObservable Update(string owner, string name, int number, IssueUpdate issueUpdate) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - Ensure.ArgumentNotNull(issueUpdate, "issueUpdate"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); + Ensure.ArgumentNotNull(issueUpdate, nameof(issueUpdate)); return _client.Update(owner, name, number, issueUpdate).ToObservable(); } @@ -468,7 +468,7 @@ public IObservable Update(string owner, string name, int number, IssueUpd /// public IObservable Update(long repositoryId, int number, IssueUpdate issueUpdate) { - Ensure.ArgumentNotNull(issueUpdate, "issueUpdate"); + Ensure.ArgumentNotNull(issueUpdate, nameof(issueUpdate)); return _client.Update(repositoryId, number, issueUpdate).ToObservable(); } @@ -482,8 +482,8 @@ public IObservable Update(long repositoryId, int number, IssueUpdate issu /// The issue number public IObservable Lock(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 _client.Lock(owner, name, number).ToObservable(); } @@ -508,8 +508,8 @@ public IObservable Lock(long repositoryId, int number) /// The issue number public IObservable Unlock(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 _client.Unlock(owner, name, number).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs b/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs index d1ea3e1e93..c435c15bb7 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesEventsClient.cs @@ -17,7 +17,7 @@ public class ObservableIssuesEventsClient : IObservableIssuesEventsClient public ObservableIssuesEventsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Issue.Events; _connection = client.Connection; @@ -34,8 +34,8 @@ public ObservableIssuesEventsClient(IGitHubClient client) /// The issue number public IObservable GetAllForIssue(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 GetAllForIssue(owner, name, number, ApiOptions.None); } @@ -65,9 +65,9 @@ public IObservable GetAllForIssue(long repositoryId, int number) /// Options for changing the API response public IObservable GetAllForIssue(string owner, string name, int number, 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 _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(owner, name, number), options); } @@ -83,7 +83,7 @@ public IObservable GetAllForIssue(string owner, string name, int numb /// Options for changing the API response public IObservable GetAllForIssue(long repositoryId, int number, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(repositoryId, number), options); } @@ -98,8 +98,8 @@ public IObservable GetAllForIssue(long repositoryId, int number, ApiO /// The name of the repository public IObservable GetAllForRepository(string owner, string name) { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); + Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); return GetAllForRepository(owner, name, ApiOptions.None); } @@ -127,9 +127,9 @@ public IObservable GetAllForRepository(long repositoryId) /// Options for changing the API response public IObservable GetAllForRepository(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 _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(owner, name), options); } @@ -144,7 +144,7 @@ public IObservable GetAllForRepository(string owner, string name, Ap /// Options for changing the API response public IObservable GetAllForRepository(long repositoryId, ApiOptions options) { - Ensure.ArgumentNotNull(options, "options"); + Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.IssuesEvents(repositoryId), options); } @@ -160,8 +160,8 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptions /// The event id public IObservable 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 _client.Get(owner, name, number).ToObservable(); } diff --git a/Octokit.Reactive/Clients/ObservableIssuesLabelsClient.cs b/Octokit.Reactive/Clients/ObservableIssuesLabelsClient.cs index 0d2c9162ba..ff23308b4c 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesLabelsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesLabelsClient.cs @@ -19,7 +19,7 @@ public class ObservableIssuesLabelsClient : IObservableIssuesLabelsClient public ObservableIssuesLabelsClient(IGitHubClient client) { - Ensure.ArgumentNotNull(client, "client"); + Ensure.ArgumentNotNull(client, nameof(client)); _connection = client.Connection; _client = client.Issue.Labels; @@ -36,8 +36,8 @@ public ObservableIssuesLabelsClient(IGitHubClient client) /// The number of the issue public IObservable