예제 #1
0
        public async Task <IEnumerable <GitHubIssue> > GetGitHubIssuesAsync()
        {
            //TODO: retrict to a reasonable amount of Issues
            var issues = await IssuesCollection.OfType <GitHubIssueInternal>().ToListAsync();

            return(_mapper.Map <IEnumerable <GitHubIssueInternal>, IEnumerable <GitHubIssue> >(issues));
        }
예제 #2
0
        public async Task <GitHubIssue> GetGitHubIssueAsync(long id)
        {
            if (id <= 0)
            {
                throw new ArgumentOutOfRangeException("id", "id cannot be less than or equal to zero");
            }

            var issueInternal = await IssuesCollection.OfType <GitHubIssueInternal>().SingleOrDefaultAsync(m => m.Id == id);

            if (issueInternal == null)
            {
                return(null);
            }
            else
            {
                return(_mapper.Map <GitHubIssueInternal, GitHubIssue>(issueInternal));
            }
        }