Correction... I'm not sure when you are accessing the Values property. It is thread safe when using LINQ on the object itself.
LINQ will use the GetEnumerator method to itterate the items.
Straight from MSDN
The enumerator returned from the dictionary is safe to use concurrently with reads and writes to the dictionary, however it does not represent a moment-in-time snapshot of the dictionary. The contents exposed through the enumerator may contain modifications made to the dictionary after GetEnumerator was called
if myDict.Any(x => !x.Value.HasPaid))
{
return false
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…