Мелкая правка (почему-то не отправилось сразу).
This commit is contained in:
parent
4ec9fa5f30
commit
b25a248c54
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user