ПИбд-23 Юнусов Нияз Наилевич Лабораторная работа №7 усложненная #17

Closed
Yunusov_Niyaz wants to merge 8 commits from Lab7_Hard into Lab6_Hard
2 changed files with 8 additions and 5 deletions
Showing only changes of commit c201ba7e06 - Show all commits

View File

@ -216,7 +216,7 @@ namespace CarRepairShopDatabaseImplement.Migrations
modelBuilder.Entity("CarRepairShopDatabaseImplement.Models.MessageInfo", b =>
{
b.HasOne("CarRepairShopDatabaseImplement.Models.Client", "Client")
.WithMany()
.WithMany("MessageInfos")
.HasForeignKey("ClientId");
b.Navigation("Client");
@ -268,7 +268,9 @@ namespace CarRepairShopDatabaseImplement.Migrations
modelBuilder.Entity("CarRepairShopDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
b.Navigation("MessageInfos");
b.Navigation("Orders");
});
modelBuilder.Entity("CarRepairShopDatabaseImplement.Models.Component", b =>

View File

@ -16,9 +16,10 @@ namespace CarRepairShopDatabaseImplement.Models
[Required]
public string Password { get; set; } = string.Empty;
[ForeignKey("ClientId")]
public virtual List<Order> Orders { get; set; } =
new();
public static Client? Create(ClientBindingModel model)
public virtual List<Order> Orders { get; set; } = new();
[ForeignKey("ClientId")]
public virtual List<MessageInfo> MessageInfos { get; set; } = new();
public static Client? Create(ClientBindingModel model)
{
if (model == null)
{