Use string Interpolation for constructing Urls (#324)

This commit is contained in:
Hisham Bin Ateya
2020-04-03 19:44:54 +03:00
committed by GitHub
parent 2433cc06be
commit 7786cd027b
22 changed files with 124 additions and 108 deletions

View File

@ -28,13 +28,13 @@ namespace Oqtane.Services
public async Task<List<Package>> GetPackagesAsync(string tag)
{
List<Package> packages = await _http.GetJsonAsync<List<Package>>(Apiurl + "?tag=" + tag);
List<Package> packages = await _http.GetJsonAsync<List<Package>>($"{Apiurl}?tag={tag}");
return packages.OrderByDescending(item => item.Downloads).ToList();
}
public async Task DownloadPackageAsync(string packageId, string version, string folder)
{
await _http.PostJsonAsync(Apiurl + "?packageid=" + packageId + "&version=" + version + "&folder=" + folder, null);
await _http.PostJsonAsync($"{Apiurl}?packageid={packageId}&version={version}&folder={folder}", null);
}
}
}