Hi Terry,
If I understand you you have a set of strings from the user input, then you want to use that to create a IN filter but with numbers, right?
If that is correct, you should:
- Convert the user input to something usable. For instance, if the user enters a comma separated string you can use some method like:
static int[] SplitStringIntoInts(string list)
{
List<int> numbers = new List<int>();
foreach (string stringValue in list.Split(','))
{
int number;
if (int.TryParse(stringValue, out number))
{
numbers.Add(number);
}
}
return numbers.ToArray();
}
or whatever method you use to transform such user input into usable numbers.
- Then you can easily create a filter that create the IN predicate. This is the easiest way:
string list = theUserInput;
int[] numbers = SplitStringIntoInts(list);
myPredicate.Add(OrderFieldsOrderId == numbers);
// fetch..., etc
Hope I understood what you really want.