Подправил сущности, сделал миграцию
This commit is contained in:
@@ -8,4 +8,15 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.18">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ServiceStationDatabaseImplement\ServiceStationDatabaseImplement.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -23,7 +23,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarTechnicalWorks)
|
||||
.ThenInclude(x => x.TechnicalWork)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Repairs)
|
||||
.Include(x => x.Executor)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
@@ -41,7 +41,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarTechnicalWorks)
|
||||
.ThenInclude(x => x.TechnicalWork)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Repairs)
|
||||
.Include(x => x.Executor)
|
||||
.Where(x => x.ExecutorId == model.ExecutorId)
|
||||
.ToList()
|
||||
@@ -53,7 +53,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarTechnicalWorks)
|
||||
.ThenInclude(x => x.TechnicalWork)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Repairs)
|
||||
.Include(x => x.Executor)
|
||||
.Where(x => x.DefectType == model.DefectType)
|
||||
.ToList()
|
||||
@@ -72,7 +72,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarTechnicalWorks)
|
||||
.ThenInclude(x => x.TechnicalWork)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Repairs)
|
||||
.Include(x => x.Executor)
|
||||
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.DefectType) && x.DefectType == model.DefectType) || (model.Id.HasValue && x.Id == model.Id))?
|
||||
.GetViewModel;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartWorks)
|
||||
.ThenInclude(x => x.Work)
|
||||
.Include(x => x.Defect)
|
||||
//.Include(x => x.Defect)
|
||||
.Include(x => x.Guarantor)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
@@ -40,7 +40,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartWorks)
|
||||
.ThenInclude(x => x.Work)
|
||||
.Include(x => x.Defect)
|
||||
//.Include(x => x.Defect)
|
||||
.Include(x => x.Guarantor)
|
||||
.Where(x => x.GuarantorId == model.GuarantorId)
|
||||
.ToList()
|
||||
@@ -52,7 +52,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartWorks)
|
||||
.ThenInclude(x => x.Work)
|
||||
.Include(x => x.Defect)
|
||||
//.Include(x => x.Defect)
|
||||
.Include(x => x.Guarantor)
|
||||
.Where(x => x.RepairName == model.RepairName)
|
||||
.ToList()
|
||||
@@ -71,7 +71,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartWorks)
|
||||
.ThenInclude(x => x.Work)
|
||||
.Include(x => x.Defect)
|
||||
//.Include(x => x.Defect)
|
||||
.Include(x => x.Guarantor)
|
||||
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.RepairName) && x.RepairName == model.RepairName) || (model.Id.HasValue && x.Id == model.Id))?
|
||||
.GetViewModel;
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarDefects)
|
||||
.ThenInclude(x => x.Defect)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Work)
|
||||
.Include(x => x.Executor)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
@@ -45,7 +45,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarDefects)
|
||||
.ThenInclude(x => x.Defect)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Work)
|
||||
.Include(x => x.Executor)
|
||||
.Where(x => x.DateStartWork >= model.DateFrom && x.DateStartWork <= model.DateTo && x.ExecutorId == model.ExecutorId)
|
||||
.Select(x => x.GetViewModel)
|
||||
@@ -58,7 +58,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarDefects)
|
||||
.ThenInclude(x => x.Defect)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Work)
|
||||
.Include(x => x.Executor)
|
||||
.Where(x => x.ExecutorId == model.ExecutorId)
|
||||
.ToList()
|
||||
@@ -70,7 +70,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarDefects)
|
||||
.ThenInclude(x => x.Defect)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Work)
|
||||
.Include(x => x.Executor)
|
||||
.Where(x => x.WorkType.Contains(model.WorkType))
|
||||
.ToList()
|
||||
@@ -88,7 +88,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Car)
|
||||
.ThenInclude(x => x.CarDefects)
|
||||
.ThenInclude(x => x.Defect)
|
||||
//.Include(x => x.Сущность Сани)
|
||||
.Include(x => x.Work)
|
||||
.Include(x => x.Executor)
|
||||
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.WorkType) && x.WorkType == model.WorkType) || (model.Id.HasValue && x.Id == model.Id))?
|
||||
.GetViewModel;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartRepairs)
|
||||
.ThenInclude(x => x.Repair)
|
||||
.Include(x => x.TechnicalWork)
|
||||
//.Include(x => x.TechnicalWork)
|
||||
.Include(x => x.Guarantor)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
@@ -44,7 +44,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartRepairs)
|
||||
.ThenInclude(x => x.Repair)
|
||||
.Include(x => x.TechnicalWork)
|
||||
//.Include(x => x.TechnicalWork)
|
||||
.Include(x => x.Guarantor)
|
||||
.Where(x => x.GuarantorId == model.GuarantorId)
|
||||
.Select(x => x.GetViewModel)
|
||||
@@ -57,7 +57,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartRepairs)
|
||||
.ThenInclude(x => x.Repair)
|
||||
.Include(x => x.TechnicalWork)
|
||||
//.Include(x => x.TechnicalWork)
|
||||
.Include(x => x.Guarantor)
|
||||
.Where(x => x.GuarantorId == model.GuarantorId)
|
||||
.ToList()
|
||||
@@ -69,7 +69,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartRepairs)
|
||||
.ThenInclude(x => x.Repair)
|
||||
.Include(x => x.TechnicalWork)
|
||||
//.Include(x => x.TechnicalWork)
|
||||
.Include(x => x.Guarantor)
|
||||
.Where(x => x.WorkName.Contains(model.WorkName))
|
||||
.ToList()
|
||||
@@ -87,7 +87,7 @@ namespace ServiceStationDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.SparePart)
|
||||
.ThenInclude(x => x.SparePartRepairs)
|
||||
.ThenInclude(x => x.Repair)
|
||||
.Include(x => x.TechnicalWork)
|
||||
//.Include(x => x.TechnicalWork)
|
||||
.Include(x => x.Guarantor)
|
||||
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.WorkName) && x.WorkName == model.WorkName) || (model.Id.HasValue && x.Id == model.Id))?
|
||||
.GetViewModel;
|
||||
|
||||
563
ServiceStation/ServiceStationDatabaseImplement/Migrations/20240427193650_InitMigration.Designer.cs
generated
Normal file
563
ServiceStation/ServiceStationDatabaseImplement/Migrations/20240427193650_InitMigration.Designer.cs
generated
Normal file
@@ -0,0 +1,563 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ServiceStationDatabaseImplement;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ServiceStationDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(ServiceStationDatabase))]
|
||||
[Migration("20240427193650_InitMigration")]
|
||||
partial class InitMigration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.18")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CarBrand")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CarNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CarId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DefectId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.HasIndex("DefectId");
|
||||
|
||||
b.ToTable("CarDefects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CarId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TechnicalWorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.HasIndex("TechnicalWorkId");
|
||||
|
||||
b.ToTable("CarTechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<double>("DefectPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("DefectType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Defects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ExecutorEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Executors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GuarantorEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Guarantors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("DefectId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RepairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("RepairPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DefectId");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Repairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SparePartName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("SparePartPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("SpareParts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("RepairId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SparePartId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RepairId");
|
||||
|
||||
b.HasIndex("SparePartId");
|
||||
|
||||
b.ToTable("SparePartRepairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("SparePartId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SparePartId");
|
||||
|
||||
b.HasIndex("WorkId");
|
||||
|
||||
b.ToTable("SparePartWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime?>("DateStartWork")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("WorkPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("WorkType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.HasIndex("WorkId");
|
||||
|
||||
b.ToTable("TechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TechnicalWorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("WorkName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("WorkPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Works");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
||||
.WithMany("CarDefects")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Defect", "Defect")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("DefectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Car");
|
||||
|
||||
b.Navigation("Defect");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
||||
.WithMany("CarTechnicalWorks")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.TechnicalWork", "TechnicalWork")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("TechnicalWorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Car");
|
||||
|
||||
b.Navigation("TechnicalWork");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Defects")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Defect", null)
|
||||
.WithMany("Repairs")
|
||||
.HasForeignKey("DefectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("Repairs")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Repair", "Repair")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("RepairId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
||||
.WithMany("SparePartRepairs")
|
||||
.HasForeignKey("SparePartId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Repair");
|
||||
|
||||
b.Navigation("SparePart");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
||||
.WithMany("SparePartWorks")
|
||||
.HasForeignKey("SparePartId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Work", "Work")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("WorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("SparePart");
|
||||
|
||||
b.Navigation("Work");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("TechnicalWorks")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Work", "Work")
|
||||
.WithMany("TechnicalWorks")
|
||||
.HasForeignKey("WorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
|
||||
b.Navigation("Work");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("Works")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.Navigation("CarDefects");
|
||||
|
||||
b.Navigation("CarTechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
|
||||
b.Navigation("Repairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
|
||||
b.Navigation("Defects");
|
||||
|
||||
b.Navigation("TechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Navigation("Repairs");
|
||||
|
||||
b.Navigation("SpareParts");
|
||||
|
||||
b.Navigation("Works");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.Navigation("SpareParts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.Navigation("SparePartRepairs");
|
||||
|
||||
b.Navigation("SparePartWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.Navigation("SpareParts");
|
||||
|
||||
b.Navigation("TechnicalWorks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ServiceStationDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitMigration : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Executors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ExecutorFIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExecutorEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
ExecutorPassword = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExecutorNumber = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Executors", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Guarantors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
GuarantorFIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GuarantorEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
GuarantorPassword = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GuarantorNumber = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Guarantors", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cars",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CarNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CarBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cars", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Cars_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Defects",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DefectType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DefectPrice = table.Column<double>(type: "float", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Defects", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Defects_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SpareParts",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
SparePartName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
SparePartPrice = table.Column<double>(type: "float", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SpareParts", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SpareParts_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Works",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
WorkPrice = table.Column<double>(type: "float", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: false),
|
||||
TechnicalWorkId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Works", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Works_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CarDefects",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CarId = table.Column<int>(type: "int", nullable: false),
|
||||
DefectId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CarDefects", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CarDefects_Cars_CarId",
|
||||
column: x => x.CarId,
|
||||
principalTable: "Cars",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_CarDefects_Defects_DefectId",
|
||||
column: x => x.DefectId,
|
||||
principalTable: "Defects",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Repairs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
RepairName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
RepairPrice = table.Column<double>(type: "float", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: false),
|
||||
DefectId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Repairs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Repairs_Defects_DefectId",
|
||||
column: x => x.DefectId,
|
||||
principalTable: "Defects",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Repairs_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SparePartWorks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
SparePartId = table.Column<int>(type: "int", nullable: false),
|
||||
WorkId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SparePartWorks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SparePartWorks_SpareParts_SparePartId",
|
||||
column: x => x.SparePartId,
|
||||
principalTable: "SpareParts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SparePartWorks_Works_WorkId",
|
||||
column: x => x.WorkId,
|
||||
principalTable: "Works",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TechnicalWorks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WorkType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DateStartWork = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
WorkPrice = table.Column<double>(type: "float", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false),
|
||||
WorkId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TechnicalWorks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TechnicalWorks_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TechnicalWorks_Works_WorkId",
|
||||
column: x => x.WorkId,
|
||||
principalTable: "Works",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SparePartRepairs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
SparePartId = table.Column<int>(type: "int", nullable: false),
|
||||
RepairId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SparePartRepairs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SparePartRepairs_Repairs_RepairId",
|
||||
column: x => x.RepairId,
|
||||
principalTable: "Repairs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SparePartRepairs_SpareParts_SparePartId",
|
||||
column: x => x.SparePartId,
|
||||
principalTable: "SpareParts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CarTechnicalWorks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CarId = table.Column<int>(type: "int", nullable: false),
|
||||
TechnicalWorkId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CarTechnicalWorks", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CarTechnicalWorks_Cars_CarId",
|
||||
column: x => x.CarId,
|
||||
principalTable: "Cars",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_CarTechnicalWorks_TechnicalWorks_TechnicalWorkId",
|
||||
column: x => x.TechnicalWorkId,
|
||||
principalTable: "TechnicalWorks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CarDefects_CarId",
|
||||
table: "CarDefects",
|
||||
column: "CarId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CarDefects_DefectId",
|
||||
table: "CarDefects",
|
||||
column: "DefectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cars_ExecutorId",
|
||||
table: "Cars",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CarTechnicalWorks_CarId",
|
||||
table: "CarTechnicalWorks",
|
||||
column: "CarId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CarTechnicalWorks_TechnicalWorkId",
|
||||
table: "CarTechnicalWorks",
|
||||
column: "TechnicalWorkId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Defects_ExecutorId",
|
||||
table: "Defects",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Repairs_DefectId",
|
||||
table: "Repairs",
|
||||
column: "DefectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Repairs_GuarantorId",
|
||||
table: "Repairs",
|
||||
column: "GuarantorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SparePartRepairs_RepairId",
|
||||
table: "SparePartRepairs",
|
||||
column: "RepairId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SparePartRepairs_SparePartId",
|
||||
table: "SparePartRepairs",
|
||||
column: "SparePartId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SpareParts_GuarantorId",
|
||||
table: "SpareParts",
|
||||
column: "GuarantorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SparePartWorks_SparePartId",
|
||||
table: "SparePartWorks",
|
||||
column: "SparePartId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SparePartWorks_WorkId",
|
||||
table: "SparePartWorks",
|
||||
column: "WorkId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TechnicalWorks_ExecutorId",
|
||||
table: "TechnicalWorks",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TechnicalWorks_WorkId",
|
||||
table: "TechnicalWorks",
|
||||
column: "WorkId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Works_GuarantorId",
|
||||
table: "Works",
|
||||
column: "GuarantorId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CarDefects");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CarTechnicalWorks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SparePartRepairs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SparePartWorks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cars");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TechnicalWorks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Repairs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SpareParts");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Works");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Defects");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Guarantors");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Executors");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,560 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ServiceStationDatabaseImplement;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ServiceStationDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(ServiceStationDatabase))]
|
||||
partial class ServiceStationDatabaseModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.18")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CarBrand")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CarNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CarId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("DefectId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.HasIndex("DefectId");
|
||||
|
||||
b.ToTable("CarDefects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CarId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TechnicalWorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CarId");
|
||||
|
||||
b.HasIndex("TechnicalWorkId");
|
||||
|
||||
b.ToTable("CarTechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<double>("DefectPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("DefectType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Defects");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ExecutorEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExecutorPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Executors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("GuarantorEmail")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorFIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorNumber")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GuarantorPassword")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Guarantors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("DefectId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("RepairName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("RepairPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DefectId");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Repairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SparePartName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("SparePartPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("SpareParts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("RepairId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SparePartId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RepairId");
|
||||
|
||||
b.HasIndex("SparePartId");
|
||||
|
||||
b.ToTable("SparePartRepairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("SparePartId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SparePartId");
|
||||
|
||||
b.HasIndex("WorkId");
|
||||
|
||||
b.ToTable("SparePartWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<DateTime?>("DateStartWork")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("WorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<double>("WorkPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<string>("WorkType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.HasIndex("WorkId");
|
||||
|
||||
b.ToTable("TechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("TechnicalWorkId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("WorkName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<double>("WorkPrice")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Works");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
||||
.WithMany("CarDefects")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Defect", "Defect")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("DefectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Car");
|
||||
|
||||
b.Navigation("Defect");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
||||
.WithMany("CarTechnicalWorks")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.TechnicalWork", "TechnicalWork")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("TechnicalWorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Car");
|
||||
|
||||
b.Navigation("TechnicalWork");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Defects")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Defect", null)
|
||||
.WithMany("Repairs")
|
||||
.HasForeignKey("DefectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("Repairs")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Repair", "Repair")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("RepairId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
||||
.WithMany("SparePartRepairs")
|
||||
.HasForeignKey("SparePartId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Repair");
|
||||
|
||||
b.Navigation("SparePart");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
||||
.WithMany("SparePartWorks")
|
||||
.HasForeignKey("SparePartId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Work", "Work")
|
||||
.WithMany("SpareParts")
|
||||
.HasForeignKey("WorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("SparePart");
|
||||
|
||||
b.Navigation("Work");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("TechnicalWorks")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Work", "Work")
|
||||
.WithMany("TechnicalWorks")
|
||||
.HasForeignKey("WorkId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
|
||||
b.Navigation("Work");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
||||
.WithMany("Works")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guarantor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
||||
{
|
||||
b.Navigation("CarDefects");
|
||||
|
||||
b.Navigation("CarTechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
|
||||
b.Navigation("Repairs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
|
||||
b.Navigation("Defects");
|
||||
|
||||
b.Navigation("TechnicalWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Navigation("Repairs");
|
||||
|
||||
b.Navigation("SpareParts");
|
||||
|
||||
b.Navigation("Works");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
||||
{
|
||||
b.Navigation("SpareParts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
||||
{
|
||||
b.Navigation("SparePartRepairs");
|
||||
|
||||
b.Navigation("SparePartWorks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
||||
{
|
||||
b.Navigation("SpareParts");
|
||||
|
||||
b.Navigation("TechnicalWorks");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
@@ -26,6 +27,7 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
|
||||
public virtual Executor Executor { get; set; }
|
||||
|
||||
|
||||
private Dictionary<int, ICarModel>? _defectCars = null;
|
||||
[NotMapped]
|
||||
public Dictionary<int, ICarModel> DefectCars
|
||||
@@ -41,8 +43,8 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
}
|
||||
[ForeignKey("DefectId")]
|
||||
public virtual List<CarDefect> Cars { get; set; } = new();
|
||||
|
||||
//внешний ключ к сущности Сани
|
||||
[ForeignKey("DefectId")]
|
||||
public virtual List<Repair> Repairs { get; set; } = new();
|
||||
|
||||
public static Defect? Create(ServiceStationDatabase context, DefectBindingModel model)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
|
||||
public virtual Guarantor Guarantor { get; set; }
|
||||
|
||||
public virtual Defect Defect { get; set; }
|
||||
//public virtual Defect Defect { get; set; }
|
||||
|
||||
private Dictionary<int, ISparePartModel>? _repairSpareParts = null;
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
[ForeignKey("RepairId")]
|
||||
public virtual List<SparePartRepair> SpareParts { get; set; } = new();
|
||||
|
||||
[ForeignKey("RepairId")]
|
||||
public virtual List<Defect> Defects { get; set; } = new();
|
||||
//[ForeignKey("RepairId")]
|
||||
//public virtual List<Defect> Defects { get; set; } = new();
|
||||
|
||||
public static Repair? Create(ServiceStationDatabase context, RepairBindingModel model)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
[Required]
|
||||
public int ExecutorId { get; set; }
|
||||
public virtual Executor Executor { get; set; }
|
||||
public virtual Work Work { get; set; }
|
||||
|
||||
private Dictionary<int, ICarModel>? _technicalWorkCars = null;
|
||||
public Dictionary<int, ICarModel> TechnicalWorkCars
|
||||
@@ -42,8 +43,6 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
[ForeignKey("TechnicalWorkId")]
|
||||
public virtual List<CarTechnicalWork> Cars { get; set; } = new();
|
||||
|
||||
//внешний ключ у сущности Сани
|
||||
|
||||
public static TechnicalWork? Create(ServiceStationDatabase context, TechnicalWorkBindingModel model)
|
||||
{
|
||||
if (model == null) return null;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ServiceStationDatabaseImplement.Models
|
||||
|
||||
public virtual Guarantor Guarantor { get; set; }
|
||||
|
||||
public virtual TechnicalWork TechnicalWork { get; set; }
|
||||
//public virtual TechnicalWork TechnicalWork { get; set; }
|
||||
|
||||
private Dictionary<int, ISparePartModel>? _workSpareParts = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user