structured logging

This commit is contained in:
Shaun Walker
2019-10-22 11:57:28 -04:00
parent ce25967633
commit 2e3a4efb74
79 changed files with 891 additions and 497 deletions

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using Oqtane.Models;
namespace Oqtane.Repository
{
public class LogRepository : ILogRepository
{
private TenantDBContext db;
public LogRepository(TenantDBContext context)
{
db = context;
}
public void AddLog(Log Log)
{
db.Log.Add(Log);
db.SaveChanges();
}
public IEnumerable<Log> GetLogs(int SiteId)
{
return db.Log.Where(item => item.SiteId == SiteId).OrderByDescending(item=> item.LogDate).Take(50);
}
}
}