没有可访问的“Sum”接受此数目的类型实参
Private m_skus As System.Collections.Generic.Dictionary(Of String, SKUItem)
Public ReadOnly Property Stock() As Integer
Get
Return Me.m_skus.Values.Sum(Of SKUItem)(Function(sku As SKUItem) sku.Stock)
End Get
End Property
提示错误:
没有可访问的“Sum”接受此数目的类型实参,因此重载决策失败。
Dictionary
[解决办法]
Private m_skus As System.Collections.Generic.Dictionary(Of String, SKUItem)
Public ReadOnly Property Stock() As Integer
Get
Return Me.m_skus.Values.Sum((Function(sku As SKUItem) sku.Stock))
End Get
End Property