I have an LLBLGen Pro project which has generated VB.Net 2.0 Self Servicing code.
I have a function to return a list of custom structures based on a search using the generated code.
I would like to supply a Dictionary of FieldNames and Values to this function and for each one add a new Predicate Expression to the search.
How can I check the String within the dictionary that represents the Field name and work out which EntityField to add the Predciate Expression for?
Code Sample
Dim dbFiles As New AllFilesCollection
Dim dbFilter As New PredicateExpression
If Not String.IsNullOrEmpty(ClientName) Then
dbFilter.Add(New PredicateExpression(AllFilesFields.ClientMenuName = ClientName))
End If
If Not String.IsNullOrEmpty(SearchText) Then
dbFilter.Add(New FieldLikePredicate(AllFilesFields.ClientReference, "%" & SearchText & "%"))
dbFilter.AddWithOr(New FieldLikePredicate(AllFilesFields.Cmsnumber, "%" & SearchText & "%"))
End If
For Each Filter As KeyValuePair(Of String, String) In Filters
'Custom code here to determine the field to add a filter for.
Next
dbFiles.GetMulti(dbFilter)