コード例 #1
0
    protected virtual async Task <bool> SpecifiedVersionExists(string version, string packageId)
    {
        var versionList = await _nuGetService.GetPackageVersionListAsync(packageId);

        if (versionList.All(v => !v.Equals(version, StringComparison.OrdinalIgnoreCase)))
        {
            versionList = await _nuGetService.GetPackageVersionListAsync(packageId, true);
        }

        return(versionList.Any(v => v.Equals(version, StringComparison.OrdinalIgnoreCase)));
    }