using Mapster; using Microsoft.EntityFrameworkCore; using Persistence.Database.Model; using Persistence.Models; using Persistence.Repositories; namespace Persistence.Repository.Repositories; public class ChangeLogRepository : IChangeLogRepository { private DbContext db; public ChangeLogRepository(DbContext db) { this.db = db; } public Task Clear(int idUser, CancellationToken token) { throw new NotImplementedException(); } public Task ClearAndInsertRange(int idUser, IEnumerable> dtos, CancellationToken token) { throw new NotImplementedException(); } public Task> GetChangeLogForDate(DateTimeOffset? updateFrom, CancellationToken token) { throw new NotImplementedException(); } public Task>> GetCurrent(DateTimeOffset moment, CancellationToken token) { throw new NotImplementedException(); } public Task> GetDatesChange(CancellationToken token) { throw new NotImplementedException(); } public Task>> GetGtDate(DateTimeOffset dateBegin, CancellationToken token) { throw new NotImplementedException(); } public Task InsertRange(Guid idUser, Guid idDiscriminator, IEnumerable dtos, CancellationToken token) { var entities = new List(); foreach (var dto in dtos) { var entity = new ChangeLog() { IdAuthor = idUser, IdDiscriminator = idDiscriminator, IdEditor = idUser, Value = dto.Value, Creation = DateTimeOffset.UtcNow, IdSection = dto.IdSection, DepthStart = dto.DepthStart, DepthEnd = dto.DepthEnd, }; entity.Id = idUser; entities.Add(entity); } db.Set().AddRange(entities); var result = db.SaveChangesAsync(token); return result; } 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(); } }