Refactor to eliminate repetitive code.

This commit is contained in:
Mike Casas
2020-10-06 08:11:00 -04:00
parent 0a9edd8916
commit 7b3dfc49b2

View File

@ -173,13 +173,15 @@ namespace Oqtane.Services
// add entityid parameter to url for custom authorization policy // add entityid parameter to url for custom authorization policy
public string CreateAuthorizationPolicyUrl(string url, int entityId) public string CreateAuthorizationPolicyUrl(string url, int entityId)
{ {
string qs = "entityid=" + entityId.ToString();
if (url.Contains("?")) if (url.Contains("?"))
{ {
return url + "&entityid=" + entityId.ToString(); return url + "&" + qs;
} }
else else
{ {
return url + "?entityid=" + entityId.ToString(); return url + "?" + qs;
} }
} }