using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Persistence.Models; namespace Persistence.Repositories; public abstract class AbstractChangeLogRepository : IChangeLogRepository where TDto : class, new() where TEntity : class, IChangeLogAbstract { private readonly DbContext dbContext; protected AbstractChangeLogRepository(DbContext dbContext) { this.dbContext = dbContext; } public Task Clear(int idUser, TRequest request, CancellationToken token) { throw new NotImplementedException(); } public Task ClearAndInsertRange(int idUser, TRequest request, IEnumerable dtos, CancellationToken token) { throw new NotImplementedException(); } public Task> GetCurrent(TRequest request, CancellationToken token) { throw new NotImplementedException(); } public Task> GetDatesChange(TRequest request, CancellationToken token) { throw new NotImplementedException(); } public Task> GetGtDate(DateTimeOffset date, CancellationToken token) { throw new NotImplementedException(); } public Task InsertRange(int idUser, IEnumerable dtos, CancellationToken token) { this.dbContext.Set(); var db = GetDataBase(); using var transaction = db.BeginTransaction(); try { //var result = await InsertRangeWithoutTransaction(idUser, dtos, token); //await transaction.CommitAsync(token); //return result; } catch { //await transaction.RollbackAsync(token); throw; } } protected abstract DatabaseFacade GetDataBase(); public Task MarkAsDeleted(int idUser, IEnumerable ids, CancellationToken token) { throw new NotImplementedException(); } public Task UpdateOrInsertRange(int idUser, IEnumerable dtos, CancellationToken token) { throw new NotImplementedException(); } public Task UpdateRange(int idUser, IEnumerable dtos, CancellationToken token) { throw new NotImplementedException(); } public Task>> GetChangeLogForDate(TRequest request, DateOnly? date, CancellationToken token) { throw new NotImplementedException(); } }