feat: Из dal перенесены все модели в Domain. Из dal переименованы service в repository, вынесены в Core.
This commit is contained in:
13
PARR.DAL/Repositories/Job/FieldFilterRepository.cs
Normal file
13
PARR.DAL/Repositories/Job/FieldFilterRepository.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class FieldFilterRepository : BaseRepository<JobFieldFilter>, IFieldFilterRepository
|
||||
{
|
||||
public FieldFilterRepository(DataContext dataContext, ILogger<FieldFilterRepository> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
21
PARR.DAL/Repositories/Job/JobAutoControlRepository.cs
Normal file
21
PARR.DAL/Repositories/Job/JobAutoControlRepository.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class JobAutoControlRepository : IJobAutoControlRepository
|
||||
{
|
||||
private readonly DataContext dataContext;
|
||||
|
||||
public JobAutoControlRepository(DataContext dataContext)
|
||||
{
|
||||
this.dataContext = dataContext;
|
||||
}
|
||||
|
||||
public IQueryable<JobAutoControl> Get()
|
||||
{
|
||||
return dataContext.JobAutoControls;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
PARR.DAL/Repositories/Job/JobGroupRepository.cs
Normal file
19
PARR.DAL/Repositories/Job/JobGroupRepository.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class JobGroupRepository : BaseRepository<JobGroup>, IJobGroupRepository
|
||||
{
|
||||
public JobGroupRepository(DataContext dataContext, ILogger<JobGroupRepository> logger) : base(logger, dataContext) { }
|
||||
|
||||
|
||||
public void DeleteDistributionConfig(JobGroupDistributionConfig distributionConfig)
|
||||
{
|
||||
EntityContext.JobGroupDistributionConfigs.Remove(distributionConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
PARR.DAL/Repositories/Job/JobGroupTypeRepository.cs
Normal file
13
PARR.DAL/Repositories/Job/JobGroupTypeRepository.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class JobGroupTypeRepository : BaseRepository<JobGroupType>, IJobGroupTypeRepository
|
||||
{
|
||||
public JobGroupTypeRepository(DataContext dataContext, ILogger<JobGroupTypeRepository> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
39
PARR.DAL/Repositories/Job/JobRepository.cs
Normal file
39
PARR.DAL/Repositories/Job/JobRepository.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class JobRepository : BaseRepository<Domain.Entities.Job.Job>, IJobRepository
|
||||
{
|
||||
public JobRepository(DataContext dataContext, ILogger<JobRepository> logger) : base(logger, dataContext) { }
|
||||
|
||||
public override Task<bool> CreateAsync(Domain.Entities.Job.Job obj)
|
||||
{
|
||||
if (obj.AutoControl == null)
|
||||
obj.AutoControl = new JobAutoControl
|
||||
{
|
||||
JobId = obj.Id
|
||||
};
|
||||
|
||||
return base.CreateAsync(obj);
|
||||
}
|
||||
|
||||
|
||||
public override Task<bool> AddRangeAsync(List<Domain.Entities.Job.Job> objs)
|
||||
{
|
||||
objs.ForEach(job =>
|
||||
{
|
||||
if (job.AutoControl == null)
|
||||
job.AutoControl = new JobAutoControl
|
||||
{
|
||||
JobId = job.Id
|
||||
};
|
||||
});
|
||||
|
||||
return base.AddRangeAsync(objs);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
PARR.DAL/Repositories/Job/JobUnitFilterRepository.cs
Normal file
13
PARR.DAL/Repositories/Job/JobUnitFilterRepository.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.Core.Repositories.Interfaces.Job;
|
||||
using PARR.DAL.Context;
|
||||
using PARR.DAL.Repositories.Base;
|
||||
using PARR.Domain.Entities.Job;
|
||||
|
||||
namespace PARR.DAL.Repositories.Job
|
||||
{
|
||||
internal class JobUnitFilterRepository : BaseRepository<JobUnitFilter>, IJobUnitFilterRepository
|
||||
{
|
||||
public JobUnitFilterRepository(DataContext dataContext, ILogger<JobUnitFilterRepository> logger) : base(logger, dataContext) { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user