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

@ -30,12 +30,12 @@ namespace Oqtane.Services
public async Task<List<Log>> GetLogsAsync(int siteId, string level, string function, int rows)
{
return await _http.GetJsonAsync<List<Log>>(Apiurl + "?siteid=" + siteId.ToString() + "&level=" + level + "&function=" + function + "&rows=" + rows.ToString());
return await _http.GetJsonAsync<List<Log>>($"{Apiurl}?siteid={siteId.ToString()}&level={level}&function={function}&rows={rows.ToString()}");
}
public async Task<Log> GetLogAsync(int logId)
{
return await _http.GetJsonAsync<Log>(Apiurl + "/" + logId.ToString());
return await _http.GetJsonAsync<Log>($"{Apiurl}/{logId.ToString()}");
}
public async Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args)