mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 00:06:05 -07:00
A lot of clean up and added a new Image api #865
This commit is contained in:
parent
69d75976c5
commit
1eb18b3187
32 changed files with 454 additions and 61 deletions
39
src/Ombi.Store/Repository/AuditRepository.cs
Normal file
39
src/Ombi.Store/Repository/AuditRepository.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue