I have an object of type Person which has only two properties: Name and Place. I have an azure table of the same name with the same two columns and an additional column called Date. I have to fetch date based on condition that either the name or place exist in table.I have seperate lists for name and place from wherein it should match the value. For example:
//some data into these lists
List<string> nameList = new List<string>();
List<string> placeList = new List<string>();
After some research, I have tried something like this:
IEnumerable<Person> query = (from p in table.CreateQuery<Person>() where nameList .Contains(p.Name)|| placeList .Contains(p.Place) select p);
But this gives an error saying not supported. What would be the best way to achieve this? Please note the name and place list can contain 1000s of entries.
Update
This is the error message :
The expression (value(System.Collections.Generic.List`1[System.String]).Contains([10007].Name) Or
value(System.Collections.Generic.List`1[System.String]).Contains([10007].Place)) is not supported.
I have finally figured it out. I used the GenerateFilterCondition and the CombineFilters to achieve it.
Code:
Hope it helps others! Cheers!!