Eliseev E.E. LabWork03 #4

Closed
ElEgEv wants to merge 12 commits from LabWork03 into LabWork02
Showing only changes of commit b25a248c54 - Show all commits

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;
}
}
}