change defaultvalue parameter to defaultResult to make more intuitive
This commit is contained in:
parent
19e3cef7dd
commit
4bdcb974bd
|
@ -148,14 +148,14 @@ namespace Oqtane.Services
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task<T> GetJsonAsync<T>(string uri, T defaultvalue)
|
protected async Task<T> GetJsonAsync<T>(string uri, T defaultResult)
|
||||||
{
|
{
|
||||||
var response = await GetHttpClient().GetAsync(uri, HttpCompletionOption.ResponseHeadersRead, CancellationToken.None);
|
var response = await GetHttpClient().GetAsync(uri, HttpCompletionOption.ResponseHeadersRead, CancellationToken.None);
|
||||||
if (await CheckResponse(response, uri) && ValidateJsonContent(response.Content))
|
if (await CheckResponse(response, uri) && ValidateJsonContent(response.Content))
|
||||||
{
|
{
|
||||||
return await response.Content.ReadFromJsonAsync<T>();
|
return await response.Content.ReadFromJsonAsync<T>();
|
||||||
}
|
}
|
||||||
return defaultvalue;
|
return defaultResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task PutAsync(string uri)
|
protected async Task PutAsync(string uri)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user