예제 #1
0
        public async Task <IActionResult> Search(string q, int pagesize = 30, int page = 0)
        {
            var srr = new SearchRepositoriesRequest(q)
            {
                PerPage = pagesize,
                Page    = page,
                In      = new[] { InQualifier.Name },
            };

            try
            {
                var result = await _githubClient.Search.SearchRepo(srr);

                var ids = _localServiceClient.GetRepos()?
                          .Select(m => m.Id);
                if (ids != null)
                {
                    return(Json(result.Items.Where(i => !ids.Contains(i.Id.ToString()))));
                }

                return(Json(result.Items));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Problem");
                return(Problem());
            }
        }
예제 #2
0
 public IActionResult Get()
 {
     return(Json(_localServiceClient.GetRepos()));
 }