A lot of clean up and added a new Image api #865

This commit is contained in:
Jamie.Rees 2017-08-01 16:14:47 +01:00
parent 69d75976c5
commit 1eb18b3187
32 changed files with 454 additions and 61 deletions

View 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();
}
}
}