diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs index bac69ed..742aa11 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs @@ -22,21 +22,21 @@ namespace BlacksmithWorkshopDatabaseImplement.Models [Required] public double Price { get; set; } - public Dictionary? ManufactureWorkPieces = null; + public Dictionary? _manufactureWorkPieces = null; //это поле не будет "мапиться" в бд [NotMapped] - public Dictionary _manufactureWorkPieces + public Dictionary 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; } } }