>>>>Int16 closeDrawers = 2; >>>> >>>>if (closeDrawers.InList(2,4)) >>>> >>>>>>>>
>> public static bool InList<T>(this T s, params T[] list) >> { >> return list.Contains(s); >> }>
>> public static bool InList (this Int16 s, params Int16[] list) >> { >> return list.Contains(s); >> }>
>if (((Int)closeDrawers).InList(2,4)) >>
>>>>if (closeDrawers.InList( (int16)2, (int16)4)) >I picked up the simplest solution of declaring closeDrawers as Int32 (although in the database it's tinyint). I think C# "thinks" that 2 and 4 are Int32 constants and this is why I'm getting an error. I probably could use your solution #3 also. Wondering if that's important in any way?