Мелкая правка (почему-то не отправилось сразу).

This commit is contained in:
Programmist73 2023-03-14 11:09:37 +04:00
parent 4ec9fa5f30
commit b25a248c54

View File

@ -22,21 +22,21 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
[Required]
public double Price { get; set; }
public Dictionary<int, (IWorkPieceModel, int)>? ManufactureWorkPieces = null;
public Dictionary<int, (IWorkPieceModel, int)>? _manufactureWorkPieces = null;
//это поле не будет "мапиться" в бд
[NotMapped]
public Dictionary<int, (IWorkPieceModel, int)> _manufactureWorkPieces
public Dictionary<int, (IWorkPieceModel, int)> ManufactureWorkPieces
{
get
{
if(ManufactureWorkPieces == null)
if(_manufactureWorkPieces == null)
{
ManufactureWorkPieces = WorkPieces
_manufactureWorkPieces = WorkPieces
.ToDictionary(recPC => recPC.WorkPieceId, recPC => (recPC.WorkPiece as IWorkPieceModel, recPC.Count));
}
return ManufactureWorkPieces;
return _manufactureWorkPieces;
}
}
@ -112,7 +112,7 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
context.SaveChanges();
}
ManufactureWorkPieces = null;
_manufactureWorkPieces = null;
}
}
}