Fix naming conventions for private fields

This commit is contained in:
Hisham Bin Ateya
2020-03-05 01:46:53 +03:00
parent e74f0d7644
commit a46235ea1e
75 changed files with 1219 additions and 1219 deletions

View File

@ -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());
}
}
}