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

Closed
Yunusov_Niyaz wants to merge 10 commits from Lab4_Hard into Lab3_Hard
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 97f1a44c76 - Show all commits

View File

@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CarRepairShopDatabaseImplement.Migrations
{
[DbContext(typeof(RepairsShopDatabase))]
[Migration("20240324163100_InitialCreate")]
[Migration("20240325173603_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />

View File

@ -19,7 +19,7 @@ namespace CarRepairShopDatabaseImplement.Models
public DateTime? DateImplement { get; private set; }
[Required]
public int RepairId { get; private set; }
public virtual Repair Repair { get; set; } = new();
public virtual Repair? Repair { get; set; }
public static Order? Create(OrderBindingModel model)
{
@ -48,7 +48,7 @@ namespace CarRepairShopDatabaseImplement.Models
public OrderViewModel GetViewModel => new()
{
RepairId = RepairId,
RepairName = Repair.RepairName,
RepairName = Repair?.RepairName ?? string.Empty,
Count = Count,
Sum = Sum,
Status = Status,