Services+Worker

This commit is contained in:
Mikhail Kuznetsov
2023-06-01 16:08:25 +10:00
parent 118cd280df
commit f0d28c0802
21 changed files with 226 additions and 71 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobCategoryService : BaseService<JobCategory>, IJobCategoryService
{
private readonly DataContext dataContext;
private readonly ILogger<JobCategoryService> logger;
public JobCategoryService(DataContext dataContext, ILogger<JobCategoryService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<JobCategory> EntitySet => dataContext.JobCategories;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobJournalService : BaseService<JobJournal>, IJobJournalService
{
private readonly DataContext dataContext;
private readonly ILogger<JobJournalService> logger;
public JobJournalService(DataContext dataContext, ILogger<JobJournalService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<JobJournal> EntitySet => dataContext.JobJournals;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobModeService : BaseService<JobMode>, IJobModeService
{
private readonly DataContext dataContext;
private readonly ILogger<JobModeService> logger;
public JobModeService(DataContext dataContext, ILogger<JobModeService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<JobMode> EntitySet => dataContext.JobModes;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PARR.DAL.Services.Implementations
{
internal class JobService : BaseService<Job>, IJobService
{
private readonly DataContext dataContext;
private readonly ILogger<JobService> logger;
public JobService(DataContext dataContext,ILogger<JobService> logger):base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<Job> EntitySet => dataContext.Jobs;
protected override DataContext EntitiContext => dataContext;
}
}

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using PARR.DAL.Context;
using PARR.DAL.Models;
using PARR.DAL.Services.Abstracts;
using PARR.DAL.Services.Interfaces;
namespace PARR.DAL.Services.Implementations
{
internal class JobStatusService : BaseService<JobStatus>, IJobStatusService
{
private readonly DataContext dataContext;
private readonly ILogger<JobStatusService> logger;
public JobStatusService(DataContext dataContext, ILogger<JobStatusService> logger) : base(logger)
{
this.dataContext = dataContext;
this.logger = logger;
}
protected override DbSet<JobStatus> EntitySet => dataContext.JobStatuses;
protected override DataContext EntitiContext => dataContext;
}
}