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

@ -45,7 +45,7 @@ namespace Oqtane.Services
if (assemblies.Where(item => item.FullName.StartsWith(assemblyname + ",")).FirstOrDefault() == null)
{
// download assembly from server and load
var bytes = await _http.GetByteArrayAsync(Apiurl + "/load/" + assemblyname + ".dll");
var bytes = await _http.GetByteArrayAsync($"{Apiurl}/load/{assemblyname}.dll");
Assembly.Load(bytes);
}
}
@ -53,7 +53,7 @@ namespace Oqtane.Services
if (assemblies.Where(item => item.FullName.StartsWith(theme.AssemblyName + ",")).FirstOrDefault() == null)
{
// download assembly from server and load
var bytes = await _http.GetByteArrayAsync(Apiurl + "/load/" + theme.AssemblyName + ".dll");
var bytes = await _http.GetByteArrayAsync($"{Apiurl}/load/{theme.AssemblyName}.dll");
Assembly.Load(bytes);
}
}
@ -105,12 +105,12 @@ namespace Oqtane.Services
public async Task InstallThemesAsync()
{
await _http.GetJsonAsync<List<string>>(Apiurl + "/install");
await _http.GetJsonAsync<List<string>>($"{Apiurl}/install");
}
public async Task DeleteThemeAsync(string themeName)
{
await _http.DeleteAsync(Apiurl + "/" + themeName);
await _http.DeleteAsync($"{Apiurl}/{themeName}");
}
}
}