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

@@ -157,7 +157,7 @@ namespace PARR.DAL.Migrations
b.ToTable("JobJournals");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -234,7 +234,7 @@ namespace PARR.DAL.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.JobMode", "JobMode")
b.HasOne("PARR.DAL.Models.JobModeService", "JobModeService")
.WithMany("Jobs")
.HasForeignKey("JobModeId")
.OnDelete(DeleteBehavior.Cascade)
@@ -248,7 +248,7 @@ namespace PARR.DAL.Migrations
b.Navigation("JobCategorye");
b.Navigation("JobMode");
b.Navigation("JobModeService");
b.Navigation("JobType");
});
@@ -295,7 +295,7 @@ namespace PARR.DAL.Migrations
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Navigation("Jobs");
});

View File

@@ -178,7 +178,7 @@ namespace PARR.DAL.Migrations
b.ToTable("JobJournals");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -255,7 +255,7 @@ namespace PARR.DAL.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.JobMode", "JobMode")
b.HasOne("PARR.DAL.Models.JobModeService", "JobModeService")
.WithMany("Jobs")
.HasForeignKey("JobModeId")
.OnDelete(DeleteBehavior.Cascade)
@@ -269,7 +269,7 @@ namespace PARR.DAL.Migrations
b.Navigation("JobCategorye");
b.Navigation("JobMode");
b.Navigation("JobModeService");
b.Navigation("JobType");
});
@@ -316,7 +316,7 @@ namespace PARR.DAL.Migrations
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Navigation("Jobs");
});

View File

@@ -175,7 +175,7 @@ namespace PARR.DAL.Migrations
b.ToTable("JobJournals");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -252,7 +252,7 @@ namespace PARR.DAL.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PARR.DAL.Models.JobMode", "JobMode")
b.HasOne("PARR.DAL.Models.JobModeService", "JobModeService")
.WithMany("Jobs")
.HasForeignKey("JobModeId")
.OnDelete(DeleteBehavior.Cascade)
@@ -266,7 +266,7 @@ namespace PARR.DAL.Migrations
b.Navigation("JobCategorye");
b.Navigation("JobMode");
b.Navigation("JobModeService");
b.Navigation("JobType");
});
@@ -313,7 +313,7 @@ namespace PARR.DAL.Migrations
b.Navigation("Jobs");
});
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
modelBuilder.Entity("PARR.DAL.Models.JobModeService", b =>
{
b.Navigation("Jobs");
});

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;
}
}

View File

@@ -0,0 +1,9 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobCategoryService : IBaseService<JobCategory>
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobJournalService
{
}
}

View File

@@ -0,0 +1,9 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobModeService : IBaseService<JobMode>
{
}
}

View File

@@ -0,0 +1,9 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
public interface IJobService : IBaseService<Job>
{
}
}

View File

@@ -0,0 +1,9 @@
using PARR.DAL.Models;
using PARR.DAL.Services.Interfaces.Base;
namespace PARR.DAL.Services.Interfaces
{
internal interface IJobStatusService : IBaseService<JobStatus>
{
}
}