I have Dictionary defined as:
Private cdEmailsUploaded As New ConcurrentDictionary(Of String, Boolean)
The string contains the fullpath to an email file (MSG) and I want to create a function that returns a count of those that contain a given string in their path e.g "ProjectX".
I have assumed, possibly incorrectly, that it would be best to convert the Dictionary into an Array and then search it for the string and count the results. If there is a better way then please let me know.
The problem is that I can't get my head around the syntax to get the embedded function to search the string part of the array and not the Boolean.
What I have at the moment is:
Function QtyUploadedToLocation(sFind As String) As Integer
Dim emailsArr = cdEmailsUploaded.ToArray
Dim result As String() = Array.FindAll(emailsArr, Function(s) s.Key.StartsWith(sFind))
Return result.Length
End Function
The error I'm getting is:
Value of type 'KeyValuePair(Of String, Boolean)()' cannot be converted to 'String()' because 'KeyValuePair(Of String, Boolean)' is not derived from 'String'.