/// <summary> /// Initializes a new instance of <see cref="GitHubIssueInfo"/> /// </summary> /// <param name="project">The GitHub project the issue belongs to.</param> /// <param name="number">The issue's number.</param> public GitHubIssueInfo(GitHubProjectInfo project, int number) { if (number <= 0) { throw new ArgumentOutOfRangeException(nameof(number)); } Project = project ?? throw new ArgumentNullException(nameof(project)); Number = number; }
/// <summary> /// Initializes a new instance of <see cref="GitHubCommitInfo"/> /// </summary> /// <param name="project">The GitHub project the pull request belongs to.</param> /// <param name="number">The commit's SHA</param> public GitHubCommitInfo(GitHubProjectInfo project, string commitId) { if (String.IsNullOrWhiteSpace(commitId)) { throw new ArgumentException("Value must not be null or whitespace", nameof(commitId)); } Project = project ?? throw new ArgumentNullException(nameof(project)); CommitId = commitId; }
protected override GitHubIssueInfo CreateResult(GitHubProjectInfo project, int id) => new GitHubIssueInfo(project, id);
protected override GitHubPullRequestInfo CreateResult(GitHubProjectInfo project, int id) => new GitHubPullRequestInfo(project, id);
protected abstract TResult CreateResult(GitHubProjectInfo project, TId id);
protected override GitHubCommitInfo CreateResult(GitHubProjectInfo project, string commitId) => new GitHubCommitInfo(project, commitId);