Исправлено

This commit is contained in:
Yunusov_Niyaz 2024-05-19 14:23:43 +04:00
parent 4a31d66ac1
commit c201ba7e06
2 changed files with 8 additions and 5 deletions

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)
{