我无法理解以下行:x => x.Id == _purchase.Centre.Id
代码在这里:
private void LoadCentreOptions()
{
MaterialCentreDataSource mcds = new MaterialCentreDataSource();
List<MaterialCentre> centres = mcds.GetAll() as List<MaterialCentre>;
_blankCentre = new MaterialCentre()
{
Name = Strings.JournalViewModel_CreditedPartyOption_NotSpecified
};
centres.Insert(0, _blankCentre);
_centreOptions = new ReadOnlyCollection<MaterialCentre>(centres);
if (_purchase.Centre == null)
_purchase.Centre = _blankCentre;
else
_purchase.Centre = _centreOptions.First(x => x.Id == _purchase.Centre.Id);
}
在调试时,我正在观察 X.Id 增加了。这怎么可能?