diff --git a/AsbCloudDb/Model/AsbCloudDbContext.cs b/AsbCloudDb/Model/AsbCloudDbContext.cs index fb333ded..5c2bc261 100644 --- a/AsbCloudDb/Model/AsbCloudDbContext.cs +++ b/AsbCloudDb/Model/AsbCloudDbContext.cs @@ -41,6 +41,7 @@ namespace AsbCloudDb.Model public virtual DbSet ProcessMapPlanFunctionsAnticrashRotation => Set(); public virtual DbSet ProcessMapPlanFunctionsStaticMeasure => Set(); public virtual DbSet ProcessMapPlanRotorLoweringBit => Set(); + public virtual DbSet ProcessMapPlanSlideLoweringBit => Set(); public virtual DbSet DrillingProgramParts => Set(); public virtual DbSet FileCategories => Set(); @@ -569,6 +570,11 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); + modelBuilder.Entity() + .HasOne(p => p.Author) + .WithMany() + .OnDelete(DeleteBehavior.Restrict); + modelBuilder.Entity() .HasOne(p => p.Editor) .WithMany() @@ -674,6 +680,11 @@ namespace AsbCloudDb.Model .WithMany() .OnDelete(DeleteBehavior.Restrict); + modelBuilder.Entity() + .HasOne(p => p.Editor) + .WithMany() + .OnDelete(DeleteBehavior.Restrict); + DefaultData.DefaultContextData.Fill(modelBuilder); } diff --git a/AsbCloudDb/Model/IAsbCloudDbContext.cs b/AsbCloudDb/Model/IAsbCloudDbContext.cs index a595affe..6444ba00 100644 --- a/AsbCloudDb/Model/IAsbCloudDbContext.cs +++ b/AsbCloudDb/Model/IAsbCloudDbContext.cs @@ -102,6 +102,7 @@ namespace AsbCloudDb.Model DbSet ProcessMapPlanFunctionsAnticrashRotation { get; } DbSet ProcessMapPlanFunctionsStaticMeasure { get; } DbSet ProcessMapPlanRotorLoweringBit { get; } + DbSet ProcessMapPlanSlideLoweringBit { get; } Task RefreshMaterializedViewAsync(string mwName, CancellationToken token); Task RefreshMaterializedViewAsync(CancellationToken token) where TEntity : class; diff --git a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSlideLoweringBit.cs b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSlideLoweringBit.cs index 232ea90d..60a4ef73 100644 --- a/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSlideLoweringBit.cs +++ b/AsbCloudDb/Model/ProcessMapPlan/ProcessMapPlanSlideLoweringBit.cs @@ -18,26 +18,11 @@ public class ProcessMapPlanSlideLoweringBit : ProcessMapPlanBase [Required] public double DifferentialPressure { get; set; } - [Column("slacking_off"), Comment("Посадка, т.")] - [Range(0.0, 20.0)] - [Required] - public double SlackingOff { get; set; } - - [Column("torque_max"), Comment("Максимально допустимый момент, кН*м.")] - [Range(0.0, 35.0)] - [Required] - public double TorqueMax { get; set; } - [Column("rop_down"), Comment("Скорость вниз, м/ч.")] [Range(0.0, 999.0)] [Required] public double RopDown { get; set; } - [Column("rpm_down"), Comment("Обороты вниз, об/мин.")] - [Range(0.0, 270.0)] - [Required] - public double RpmDown { get; set; } - [Column("flow_rate_down"), Comment("Расход вниз, л/с.")] [Range(0.0, 100.0)] [Required] @@ -47,5 +32,5 @@ public class ProcessMapPlanSlideLoweringBit : ProcessMapPlanBase public string Note { get; set; } = string.Empty; [ForeignKey(nameof(IdPrevious))] - public virtual ProcessMapPlanRotorLoweringBit? Previous { get; set; } + public virtual ProcessMapPlanSlideLoweringBit? Previous { get; set; } } \ No newline at end of file diff --git a/AsbCloudInfrastructure/DependencyInjection.cs b/AsbCloudInfrastructure/DependencyInjection.cs index fc9c867c..0aeb85a3 100644 --- a/AsbCloudInfrastructure/DependencyInjection.cs +++ b/AsbCloudInfrastructure/DependencyInjection.cs @@ -278,6 +278,13 @@ namespace AsbCloudInfrastructure { Item = src.Adapt() }); + + TypeAdapterConfig>.NewConfig() + .Include>() + .Map(dest => dest, src => new ChangeLogDto() + { + Item = src.Adapt() + }); } public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration) @@ -455,6 +462,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -482,6 +490,7 @@ namespace AsbCloudInfrastructure services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -579,6 +588,10 @@ namespace AsbCloudInfrastructure IChangeLogRepository, ProcessMapPlanBaseRepository>(); + services.AddTransient< + IChangeLogRepository, + ProcessMapPlanBaseRepository>(); + services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); @@ -600,6 +613,7 @@ namespace AsbCloudInfrastructure services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); + services.AddTransient>(); return services; }