Example #1
0
 public IEnumerable <T> Values()
 {
     using (var repo = _repository)
     {
         if (_idToOverrideObject != null && _idToOverrideObject.Count > 0)
         {
             foreach (var commit in repo.Commits.AsEnumerable())
             {
                 var result = _idToOverrideObject.TryGetValue(commit.Id.ToString(), out var overrideObject) ? _parser.Parse(overrideObject) : _parser.Parse(commit);
                 if (result == null)
                 {
                     continue;
                 }
                 yield return((T)result);
             }
         }
         else
         {
             foreach (var commit in repo.Commits.AsEnumerable())
             {
                 var change = _parser.Parse(commit);
                 if (change == null)
                 {
                     continue;
                 }
                 yield return((T)change);
             }
         }
     }
 }
Example #2
0
        private async Task <List <string> > PostInternal(dynamic value)
        {
            List <string> urls = new List <string>();

            IEnumerable <Commit> commits = _parser.Parse(value);

            foreach (var commit in commits.Where(FilterBranch))
            {
                var url = await _service.AddComment(commit);

                urls.Add(url);
            }

            return(urls);
        }