mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
39 lines
983 B
C#
39 lines
983 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Ombi.Store.Context;
|
|
using Ombi.Store.Entities;
|
|
|
|
namespace Ombi.Store.Repository
|
|
{
|
|
public class AuditRepository : IAuditRepository
|
|
{
|
|
public AuditRepository(IOmbiContext ctx)
|
|
{
|
|
Ctx = ctx;
|
|
}
|
|
|
|
private IOmbiContext Ctx { get; }
|
|
|
|
|
|
public async Task Record(AuditType type, AuditArea area, string description)
|
|
{
|
|
await Record(type, area, description, string.Empty);
|
|
}
|
|
|
|
public async Task Record(AuditType type, AuditArea area, string description, string user)
|
|
{
|
|
await Ctx.Audit.AddAsync(new Audit
|
|
{
|
|
User = user,
|
|
AuditArea = area,
|
|
AuditType = type,
|
|
DateTime = DateTime.UtcNow,
|
|
Description = description
|
|
});
|
|
|
|
await Ctx.SaveChangesAsync();
|
|
}
|
|
}
|
|
}
|