81 lines
2.3 KiB
C#
81 lines
2.3 KiB
C#
using Mapster;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Persistence.Database.Model;
|
|
using Persistence.Models;
|
|
using Persistence.Repositories;
|
|
|
|
namespace Persistence.Repository.Repositories;
|
|
public class ChangeLogRepository<TDto, TChangeLogDto> : IChangeLogRepository<TDto, TChangeLogDto>
|
|
where TDto : class, IChangeLogDto, new()
|
|
where TChangeLogDto : ChangeLogDto<TDto>
|
|
{
|
|
private DbContext db;
|
|
|
|
public ChangeLogRepository(DbContext db)
|
|
{
|
|
this.db = db;
|
|
}
|
|
|
|
public Task<int> Clear(int idUser, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<int> ClearAndInsertRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TChangeLogDto>> GetChangeLogForDate(DateTimeOffset? updateFrom, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TDto>> GetCurrent(DateTimeOffset moment, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<DateOnly>> GetDatesChange(CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TDto>> GetGtDate(DateTimeOffset dateBegin, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<int> InsertRange(Guid idUser, IEnumerable<TDto> dtos, CancellationToken token)
|
|
{
|
|
var entity = new ChangeLog() {
|
|
Value = dtos,
|
|
Creation = DateTimeOffset.UtcNow,
|
|
Id = idUser,
|
|
IdAuthor = idUser,
|
|
IdDiscriminator = new Guid(),
|
|
IdEditor = idUser
|
|
};
|
|
entity.Id = idUser;
|
|
|
|
db.Set<ChangeLog>().Add(entity);
|
|
var result = db.SaveChangesAsync(token);
|
|
return result;
|
|
}
|
|
|
|
public Task<int> MarkAsDeleted(int idUser, IEnumerable<int> ids, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<int> UpdateOrInsertRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<int> UpdateRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|