示例#1
0
        /// <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;
        }
示例#2
0
        /// <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;
        }
示例#3
0
 protected override GitHubIssueInfo CreateResult(GitHubProjectInfo project, int id) => new GitHubIssueInfo(project, id);
示例#4
0
 protected override GitHubPullRequestInfo CreateResult(GitHubProjectInfo project, int id) => new GitHubPullRequestInfo(project, id);
示例#5
0
 protected abstract TResult CreateResult(GitHubProjectInfo project, TId id);
示例#6
0
 protected override GitHubCommitInfo CreateResult(GitHubProjectInfo project, string commitId) => new GitHubCommitInfo(project, commitId);