Fix naming conventions for private fields
This commit is contained in:
@ -7,18 +7,18 @@ namespace Oqtane.Repository
|
||||
{
|
||||
public class NotificationRepository : INotificationRepository
|
||||
{
|
||||
private TenantDBContext db;
|
||||
private TenantDBContext _db;
|
||||
|
||||
public NotificationRepository(TenantDBContext context)
|
||||
{
|
||||
db = context;
|
||||
_db = context;
|
||||
}
|
||||
|
||||
public IEnumerable<Notification> GetNotifications(int SiteId, int FromUserId, int ToUserId)
|
||||
{
|
||||
if (ToUserId == -1 && FromUserId == -1)
|
||||
{
|
||||
return db.Notification
|
||||
return _db.Notification
|
||||
.Where(item => item.SiteId == SiteId)
|
||||
.Where(item => item.IsDelivered == false)
|
||||
.Include(item => item.FromUser)
|
||||
@ -27,7 +27,7 @@ namespace Oqtane.Repository
|
||||
}
|
||||
else
|
||||
{
|
||||
return db.Notification
|
||||
return _db.Notification
|
||||
.Where(item => item.SiteId == SiteId)
|
||||
.Where(item => item.ToUserId == ToUserId || ToUserId == -1)
|
||||
.Where(item => item.FromUserId == FromUserId || FromUserId == -1)
|
||||
@ -39,28 +39,28 @@ namespace Oqtane.Repository
|
||||
|
||||
public Notification AddNotification(Notification Notification)
|
||||
{
|
||||
db.Notification.Add(Notification);
|
||||
db.SaveChanges();
|
||||
_db.Notification.Add(Notification);
|
||||
_db.SaveChanges();
|
||||
return Notification;
|
||||
}
|
||||
|
||||
public Notification UpdateNotification(Notification Notification)
|
||||
{
|
||||
db.Entry(Notification).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
_db.Entry(Notification).State = EntityState.Modified;
|
||||
_db.SaveChanges();
|
||||
return Notification;
|
||||
}
|
||||
|
||||
public Notification GetNotification(int NotificationId)
|
||||
{
|
||||
return db.Notification.Find(NotificationId);
|
||||
return _db.Notification.Find(NotificationId);
|
||||
}
|
||||
|
||||
public void DeleteNotification(int NotificationId)
|
||||
{
|
||||
Notification Notification = db.Notification.Find(NotificationId);
|
||||
db.Notification.Remove(Notification);
|
||||
db.SaveChanges();
|
||||
Notification Notification = _db.Notification.Find(NotificationId);
|
||||
_db.Notification.Remove(Notification);
|
||||
_db.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user