fixes the put

This commit is contained in:
Paul Schneider
2021-08-10 00:10:26 +01:00
parent e356636539
commit fff4599ff4
8 changed files with 123 additions and 17 deletions

View File

@ -19,6 +19,7 @@ namespace isnd.Services
int skip, int take,bool prerelease = false,
string packageType = null)
{
var scope = dbContext.Packages
.Include(p => p.Versions)
.Where(
@ -26,11 +27,13 @@ namespace isnd.Services
&& (prerelease || p.Versions.Any(v => !v.IsPrerelease))
&& (packageType == null || p.Versions.Any(v => v.Type == packageType))
);
var total = scope.Count();
var pkgs = scope.Skip(skip).Take(take).ToArray();
return new IndexResult
{
totalHits = scope.Count(),
data = scope.OrderBy(p => p.Id)
.Skip(skip).Take(take).ToArray()
totalHits = total,
data = pkgs
};
}
public AutoCompleteResult AutoComplete (string id,