I have several columns that I'd like to search against. My code might not get passed anything for a given column to search against. So for the example below either lastname or firstname might be an empty string. Whenever I search against a column with an empty string it messes up the query. I've fixed the problem by checking to see if it's an empty string and not querying against it if it is. However I have a lot of columns to search against so that would be a lot of if/thens and make things messy. Any advice on how to best implement?
refinedresult = From x In theresult _
Where x.<lastname>.Value.ToLower.Contains(LastName.ToLower.Trim) Or _
x.<givenname>.Value.ToLower.Contains(FirstName.ToLower.Trim) Or _
Select x