vb.net dictionary LINQ
Public Function dicFilter(ByRef dic As Dictionary(Of String, clsBean),
ByRef ret_dic As Dictionary(Of String, clsBean)) As Boolean
Try
ret_dic = dic.Where(Function(_obj)
If _obj.Value.enable= False Then
Return False
End If
Return True
End Function).ToDictionary(Function(_obj) _obj.Key, Function(_obj) _obj.Value)
If ret_dic.Any Then
Return True
End If
Return False
Catch ex As Exception
Return False
End Try
End Function
留言
張貼留言