forked from AcaMate/AcaMate_API
36 lines
929 B
C#
36 lines
929 B
C#
using Back.Program.Common.Data;
|
|
using Back.Program.Models.Entities;
|
|
using Back.Program.Repositories.V1.Interfaces;
|
|
|
|
namespace Back.Program.Repositories.V1;
|
|
|
|
public class LogRepository: ILogRepository
|
|
{
|
|
private readonly ILogger<LogRepository> _logger;
|
|
private readonly AppDbContext _context;
|
|
|
|
|
|
public LogRepository(ILogger<LogRepository> logger, AppDbContext context)
|
|
{
|
|
_logger = logger;
|
|
_context = context;
|
|
}
|
|
|
|
public async Task<bool> SaveLogUser(LogUser log)
|
|
{
|
|
_context.LogUser.Add(log);
|
|
return await _context.SaveChangesAsync() > 0;
|
|
}
|
|
|
|
public async Task<bool> SaveLogProject(LogProject log)
|
|
{
|
|
_context.LogProject.Add(log);
|
|
return await _context.SaveChangesAsync() > 0;
|
|
}
|
|
|
|
public async Task<bool> SaveLogPush(LogPush log)
|
|
{
|
|
_context.LogPush.Add(log);
|
|
return await _context.SaveChangesAsync() > 0;
|
|
}
|
|
} |