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

@ -14,8 +14,8 @@ namespace Oqtane.Services
if (alias != null)
{
// build a url which passes the alias that may include a subfolder for multi-tenancy
apiurl = uri.Scheme + "://" + alias.Name + "/";
if (alias.Path == "")
apiurl = $"{uri.Scheme}://{alias.Name}/";
if (alias.Path == string.Empty)
{
apiurl += "~/";
}
@ -23,9 +23,10 @@ namespace Oqtane.Services
else
{
// build a url which ignores any subfolder for multi-tenancy
apiurl = uri.Scheme + "://" + uri.Authority + "/~/";
apiurl = $"{uri.Scheme}://{uri.Authority}/~/";
}
apiurl += "api/" + serviceName;
apiurl += $"api/{serviceName}";
return apiurl;
}