Esempio n. 1
0
        public async Task <DependentsResponse> FindDependentsAsync(DependentsRequest request, CancellationToken cancellationToken)
        {
            var results = await _context
                          .Packages
                          .Where(p => p.Listed)
                          .OrderByDescending(p => p.Downloads)
                          .Where(p => p.Dependencies.Any(d => d.Id == request.PackageId))
                          .Skip(request.Skip)
                          .Take(request.Take)
                          .Select(p => p.Id)
                          .Distinct()
                          .ToListAsync(cancellationToken);

            return(new DependentsResponse(results.Count, results));
        }
Esempio n. 2
0
 public Task <DependentsResponse> FindDependentsAsync(DependentsRequest request, CancellationToken cancellationToken = default)
 {
     return(EmptyDependentsResponseTask);
 }