Surely there is a framework method that given an array of integers, strings etc converts them into a list that can be used in a SQL \"IN\" clause?
e.g.
///
/// Converts an array of integers into a string that may be used in a SQL IN expression.
///
/// The array to convert.
/// A string representing the array as a parenthetical comma-delemited list. If the array
/// is empty or missing, then "(null)" is returned.
public static string ToSqlInList(int[] values)
{
if (values == null || values.Length == 0)
return "(null)"; // In SQL the expression "IN (NULL)" is always false.
return string.Concat("(", string.Join(",", Array.ConvertAll(values,x=>x.ToString())), ")");
}