From 44da67f820ec94a294af29a1c76710e497268296 Mon Sep 17 00:00:00 2001 From: Stanislav Vysotskyi Date: Thu, 12 Dec 2024 15:10:23 +0300 Subject: [PATCH 1/2] Navigation property `UserSignature` at `DispenserDTO` can be `null` --- src/DispenserProvider.DataBase/Models/DispenserDTO.cs | 2 +- .../Migrations/DispenserContextModelSnapshot.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/DispenserProvider.DataBase/Models/DispenserDTO.cs b/src/DispenserProvider.DataBase/Models/DispenserDTO.cs index 3338a64..7f038c5 100644 --- a/src/DispenserProvider.DataBase/Models/DispenserDTO.cs +++ b/src/DispenserProvider.DataBase/Models/DispenserDTO.cs @@ -19,7 +19,7 @@ public class DispenserDTO [Column(TypeName = "nvarchar(132)")] public string? Signature { get; set; } - public virtual SignatureDTO UserSignature { get; set; } = null!; + public virtual SignatureDTO? UserSignature { get; set; } = null!; public long WithdrawalDetailId { get; set; } public virtual TransactionDetailDTO WithdrawalDetail { get; set; } = null!; diff --git a/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs b/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs index e3b3ad3..469ff97 100644 --- a/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs +++ b/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs @@ -53,7 +53,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("TransactionDetailId"); - b.ToTable("Builders"); + b.ToTable("Builders", (string)null); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.DispenserDTO", b => @@ -104,7 +104,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("WithdrawalDetailId") .IsUnique(); - b.ToTable("Dispenser"); + b.ToTable("Dispenser", (string)null); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.LogDTO", b => @@ -121,7 +121,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Signature"); - b.ToTable("Logs"); + b.ToTable("Logs", (string)null); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.SignatureDTO", b => @@ -140,7 +140,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Signature"); - b.ToTable("Signatures"); + b.ToTable("Signatures", (string)null); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.TransactionDetailDTO", b => @@ -159,7 +159,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("TransactionDetails"); + b.ToTable("TransactionDetails", (string)null); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.BuilderDTO", b => From de1f24ab4227ec364205be29faf41555cc2c8b9a Mon Sep 17 00:00:00 2001 From: Stanislav Vysotskyi Date: Thu, 12 Dec 2024 15:17:03 +0300 Subject: [PATCH 2/2] - revert `DispenserContextModelSnapshot` changes --- .../Migrations/DispenserContextModelSnapshot.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs b/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs index 469ff97..e3b3ad3 100644 --- a/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs +++ b/src/DispenserProvider.Migrations/Migrations/DispenserContextModelSnapshot.cs @@ -53,7 +53,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("TransactionDetailId"); - b.ToTable("Builders", (string)null); + b.ToTable("Builders"); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.DispenserDTO", b => @@ -104,7 +104,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("WithdrawalDetailId") .IsUnique(); - b.ToTable("Dispenser", (string)null); + b.ToTable("Dispenser"); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.LogDTO", b => @@ -121,7 +121,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Signature"); - b.ToTable("Logs", (string)null); + b.ToTable("Logs"); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.SignatureDTO", b => @@ -140,7 +140,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Signature"); - b.ToTable("Signatures", (string)null); + b.ToTable("Signatures"); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.TransactionDetailDTO", b => @@ -159,7 +159,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("TransactionDetails", (string)null); + b.ToTable("TransactionDetails"); }); modelBuilder.Entity("DispenserProvider.DataBase.Models.BuilderDTO", b =>