fix Синхронизации
This commit is contained in:
39
PARR.DAL/Services/Implementations/AIHIT/RawDataEKService.cs
Normal file
39
PARR.DAL/Services/Implementations/AIHIT/RawDataEKService.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.AIHIT;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Services.Interfaces.AIHIT;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.AIHIT
|
||||
{
|
||||
internal class RawDataEKService : BaseService<RawDataEK>, IRawDataEKService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<RawDataEKService> logger;
|
||||
|
||||
public RawDataEKService(DataContext dataContext, ILogger<RawDataEKService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
|
||||
public void DeleteAll()
|
||||
{
|
||||
var startCount = EntitySet.Count();
|
||||
if (startCount > 0)
|
||||
{
|
||||
EntitiContext.RawDataEKs.RemoveRange(EntitySet);
|
||||
logger.LogInformation($"Из таблицы RawDataEK удалено {startCount} записей");
|
||||
EntitiContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override DbSet<RawDataEK> EntitySet => dataContext.RawDataEKs;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user