feat: разделение на repository - services
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Job
|
||||
{
|
||||
internal class FieldFilterService : BaseService<Models.Job.JobFieldFilter>, IFieldFilterService
|
||||
internal class FieldFilterService : BaseRepository<Models.Job.JobFieldFilter>, IFieldFilterService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
protected override DbSet<Models.Job.JobFieldFilter> EntitySet => dataContext.FieldFilters;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public FieldFilterService(DataContext dataContext, ILogger<FieldFilterService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
public FieldFilterService(DataContext dataContext, ILogger<FieldFilterService> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Job;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Job
|
||||
{
|
||||
internal class JobUnitFilterService : BaseService<JobUnitFilter>, IJobUnitFilterService
|
||||
internal class JobUnitFilterService : BaseRepository<JobUnitFilter>, IJobUnitFilterService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
protected override DbSet<JobUnitFilter> EntitySet => dataContext.JobUnitFilters;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
|
||||
public JobUnitFilterService(DataContext dataContext, ILogger<JobUnitFilterService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
public JobUnitFilterService(DataContext dataContext, ILogger<JobUnitFilterService> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Job;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Job
|
||||
{
|
||||
internal class JobGroupService : BaseService<Models.Job.JobGroup>, IJobGroupService
|
||||
internal class JobGroupService : BaseRepository<Models.Job.JobGroup>, IJobGroupService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
public JobGroupService(DataContext dataContext, ILogger<JobGroupService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
protected override DbSet<JobGroup> EntitySet => dataContext.JobGroups;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public JobGroupService(DataContext dataContext, ILogger<JobGroupService> logger) : base(logger, dataContext) { }
|
||||
|
||||
|
||||
public void DeleteDistributionConfig(JobGroupDistributionConfig distributionConfig)
|
||||
{
|
||||
EntitiContext.JobGroupDistributionConfigs.Remove(distributionConfig);
|
||||
EntityContext.JobGroupDistributionConfigs.Remove(distributionConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Models.Job;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Job
|
||||
{
|
||||
internal class JobGroupTypeService : BaseService<JobGroupType>, IJobGroupTypeService
|
||||
internal class JobGroupTypeService : BaseRepository<JobGroupType>, IJobGroupTypeService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
private readonly ILogger<JobGroupTypeService> logger;
|
||||
|
||||
protected override DbSet<JobGroupType> EntitySet => dataContext.JobGroupTypes;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public JobGroupTypeService(
|
||||
DataContext dataContext,
|
||||
ILogger<JobGroupTypeService> logger
|
||||
) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
this.logger = logger;
|
||||
}
|
||||
public JobGroupTypeService(DataContext dataContext, ILogger<JobGroupTypeService> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Services.Abstracts;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.DAL.Services.Interfaces.Job;
|
||||
|
||||
namespace PARR.DAL.Services.Implementations.Job
|
||||
{
|
||||
internal class JobService : BaseService<Models.Job.Job>, IJobService
|
||||
internal class JobService : BaseRepository<Models.Job.Job>, IJobService
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
public JobService(DataContext dataContext, ILogger<JobService> logger) : base(logger)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
|
||||
protected override DbSet<Models.Job.Job> EntitySet => dataContext.Jobs;
|
||||
|
||||
protected override DataContext EntitiContext => dataContext;
|
||||
public JobService(DataContext dataContext, ILogger<JobService> logger) : base(logger, dataContext) { }
|
||||
|
||||
public override Task<bool> CreateAsync(Models.Job.Job obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user