This commit is contained in:
Yunusov_Niyaz 2024-03-25 21:45:56 +04:00
parent 0d6af8477a
commit 97f1a44c76
3 changed files with 3 additions and 3 deletions

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,