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,46 +10,46 @@ namespace Oqtane.Services
{
public class NotificationService : ServiceBase, INotificationService
{
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 NotificationService(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, "Notification"); }
get { return CreateApiUrl(_siteState.Alias, _navigationManager.Uri, "Notification"); }
}
public async Task<List<Notification>> GetNotificationsAsync(int SiteId, string Direction, int UserId)
{
string querystring = "?siteid=" + SiteId.ToString() + "&direction=" + Direction.ToLower() + "&userid=" + UserId.ToString();
List<Notification> Notifications = await http.GetJsonAsync<List<Notification>>(apiurl + querystring);
List<Notification> Notifications = await _http.GetJsonAsync<List<Notification>>(apiurl + querystring);
return Notifications.OrderByDescending(item => item.CreatedOn).ToList();
}
public async Task<Notification> GetNotificationAsync(int NotificationId)
{
return await http.GetJsonAsync<Notification>(apiurl + "/" + NotificationId.ToString());
return await _http.GetJsonAsync<Notification>(apiurl + "/" + NotificationId.ToString());
}
public async Task<Notification> AddNotificationAsync(Notification Notification)
{
return await http.PostJsonAsync<Notification>(apiurl, Notification);
return await _http.PostJsonAsync<Notification>(apiurl, Notification);
}
public async Task<Notification> UpdateNotificationAsync(Notification Notification)
{
return await http.PutJsonAsync<Notification>(apiurl + "/" + Notification.NotificationId.ToString(), Notification);
return await _http.PutJsonAsync<Notification>(apiurl + "/" + Notification.NotificationId.ToString(), Notification);
}
public async Task DeleteNotificationAsync(int NotificationId)
{
await http.DeleteAsync(apiurl + "/" + NotificationId.ToString());
await _http.DeleteAsync(apiurl + "/" + NotificationId.ToString());
}
}
}