Fix naming conventions for private fields
This commit is contained in:
@ -10,45 +10,45 @@ namespace Oqtane.Services
|
||||
{
|
||||
public class ProfileService : ServiceBase, IProfileService
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly SiteState sitestate;
|
||||
private readonly NavigationManager NavigationManager;
|
||||
private readonly HttpClient _http;
|
||||
private readonly SiteState _siteState;
|
||||
private readonly NavigationManager _navigationManager;
|
||||
|
||||
public ProfileService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||
{
|
||||
this.http = http;
|
||||
this.sitestate = sitestate;
|
||||
this.NavigationManager = NavigationManager;
|
||||
this._http = http;
|
||||
this._siteState = sitestate;
|
||||
this._navigationManager = NavigationManager;
|
||||
}
|
||||
|
||||
private string apiurl
|
||||
{
|
||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.Uri, "Profile"); }
|
||||
get { return CreateApiUrl(_siteState.Alias, _navigationManager.Uri, "Profile"); }
|
||||
}
|
||||
|
||||
public async Task<List<Profile>> GetProfilesAsync(int SiteId)
|
||||
{
|
||||
List<Profile> Profiles = await http.GetJsonAsync<List<Profile>>(apiurl + "?siteid=" + SiteId.ToString());
|
||||
List<Profile> Profiles = await _http.GetJsonAsync<List<Profile>>(apiurl + "?siteid=" + SiteId.ToString());
|
||||
return Profiles.OrderBy(item => item.ViewOrder).ToList();
|
||||
}
|
||||
|
||||
public async Task<Profile> GetProfileAsync(int ProfileId)
|
||||
{
|
||||
return await http.GetJsonAsync<Profile>(apiurl + "/" + ProfileId.ToString());
|
||||
return await _http.GetJsonAsync<Profile>(apiurl + "/" + ProfileId.ToString());
|
||||
}
|
||||
|
||||
public async Task<Profile> AddProfileAsync(Profile Profile)
|
||||
{
|
||||
return await http.PostJsonAsync<Profile>(apiurl, Profile);
|
||||
return await _http.PostJsonAsync<Profile>(apiurl, Profile);
|
||||
}
|
||||
|
||||
public async Task<Profile> UpdateProfileAsync(Profile Profile)
|
||||
{
|
||||
return await http.PutJsonAsync<Profile>(apiurl + "/" + Profile.SiteId.ToString(), Profile);
|
||||
return await _http.PutJsonAsync<Profile>(apiurl + "/" + Profile.SiteId.ToString(), Profile);
|
||||
}
|
||||
public async Task DeleteProfileAsync(int ProfileId)
|
||||
{
|
||||
await http.DeleteAsync(apiurl + "/" + ProfileId.ToString());
|
||||
await _http.DeleteAsync(apiurl + "/" + ProfileId.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user