diff --git a/AsbCloudInfrastructure/Services/WellSectionService.cs b/AsbCloudInfrastructure/Services/WellSectionService.cs index bdb4c577..1ae287c7 100644 --- a/AsbCloudInfrastructure/Services/WellSectionService.cs +++ b/AsbCloudInfrastructure/Services/WellSectionService.cs @@ -160,72 +160,6 @@ namespace AsbCloudInfrastructure.Services dto.SectionType = entity.WellSectionType.Caption; return dto; } - - //public async Task InsertAsync(WellSectionDto item, int idWell, CancellationToken token = default) - //{ - // var sectionType = await GetWellSectionTypeFromCacheAndAssertAsync(item.SectionType); - - // var entity = item.Adapt(); - // entity.Id = default; - // entity.IdWell = idWell; - // entity.IdWellSectionType = sectionType.Id; - // var dbEntity = dbSet.Add(entity); - // await context.SaveChangesAsync(token).ConfigureAwait(false); - - // var dto = dbEntity.Entity.Adapt(); - // dto.SectionType = sectionType.Caption; - // return dto; - //} - - //public async Task> InsertRangeAsync(int idWell, IEnumerable items, CancellationToken token = default) - //{ - // var dbEntities = new Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry[items.Count()]; - - // for (int i = 0; i < dbEntities.Length; i++) - // { - // var sectionType = await GetWellSectionTypeFromCacheAndAssertAsync(items.ElementAt(i).SectionType, token); - // var item = items.ElementAt(i).Adapt(); - // item.IdWell = idWell; - // item.IdWellSectionType = sectionType.Id; - // dbEntities[i] = dbSet.Add(item); - // } - - // await context.SaveChangesAsync(token).ConfigureAwait(false); - - // var dtos = dbEntities.Select((e) => { - // var dto = e.Entity.Adapt(); - // var sectionType = cachedSectionsTypes.FirstOrDefault(s => s.Id == e.Entity.IdWellSectionType); - // dto.SectionType = sectionType.Caption; - // return dto; - // }); - - // return dtos; - //} - - //public async Task UpdateAsync(int idWell, int idSection, WellSectionDto item, CancellationToken token = default) - //{ - // var sectionType = await GetWellSectionTypeFromCacheAndAssertAsync(item.SectionType, token) - // .ConfigureAwait(false); - - // var entity = item.Adapt(); - // entity.Id = idSection; - // entity.IdWell = idWell; - // entity.IdWellSectionType = sectionType.Id; - // var dbEntity = dbSet.Update(entity); - // await context.SaveChangesAsync(token).ConfigureAwait(false); - - // var dto = dbEntity.Entity.Adapt(); - // dto.SectionType = sectionType.Caption; - // return dto; - //} - - //public Task DeleteAsync(IEnumerable ids, CancellationToken token = default) - //{ - // var entities = dbSet.Where(e => ids.Contains(e.Id)); - // dbSet.RemoveRange(entities); - // return context.SaveChangesAsync(token); - //} - private static PaginationContainer PaginateData(IEnumerable> groupedCollection, int skip, int take) {