Server naming fixes and cleanup
Server is now completely cleaned up and without warnings
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Oqtane.Models;
|
||||
|
||||
@ -14,44 +13,38 @@ namespace Oqtane.Repository
|
||||
_db = context;
|
||||
}
|
||||
|
||||
public IEnumerable<Log> GetLogs(int SiteId, string Level, string Function, int Rows)
|
||||
public IEnumerable<Log> GetLogs(int siteId, string level, string function, int rows)
|
||||
{
|
||||
if (Level == null)
|
||||
if (level == null)
|
||||
{
|
||||
if (Function == null)
|
||||
if (function == null)
|
||||
{
|
||||
return _db.Log.Where(item => item.SiteId == SiteId).
|
||||
OrderByDescending(item => item.LogDate).Take(Rows);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _db.Log.Where(item => item.SiteId == SiteId && item.Function == Function).
|
||||
OrderByDescending(item => item.LogDate).Take(Rows);
|
||||
return _db.Log.Where(item => item.SiteId == siteId).
|
||||
OrderByDescending(item => item.LogDate).Take(rows);
|
||||
}
|
||||
|
||||
return _db.Log.Where(item => item.SiteId == siteId && item.Function == function).
|
||||
OrderByDescending(item => item.LogDate).Take(rows);
|
||||
}
|
||||
else
|
||||
|
||||
if (function == null)
|
||||
{
|
||||
if (Function == null)
|
||||
{
|
||||
return _db.Log.Where(item => item.SiteId == SiteId && item.Level == Level)
|
||||
.OrderByDescending(item => item.LogDate).Take(Rows);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _db.Log.Where(item => item.SiteId == SiteId && item.Level == Level && item.Function == Function)
|
||||
.OrderByDescending(item => item.LogDate).Take(Rows);
|
||||
}
|
||||
return _db.Log.Where(item => item.SiteId == siteId && item.Level == level)
|
||||
.OrderByDescending(item => item.LogDate).Take(rows);
|
||||
}
|
||||
|
||||
return _db.Log.Where(item => item.SiteId == siteId && item.Level == level && item.Function == function)
|
||||
.OrderByDescending(item => item.LogDate).Take(rows);
|
||||
}
|
||||
|
||||
public Log GetLog(int LogId)
|
||||
public Log GetLog(int logId)
|
||||
{
|
||||
return _db.Log.Find(LogId);
|
||||
return _db.Log.Find(logId);
|
||||
}
|
||||
|
||||
public void AddLog(Log Log)
|
||||
public void AddLog(Log log)
|
||||
{
|
||||
_db.Log.Add(Log);
|
||||
_db.Log.Add(log);
|
||||
_db.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user