The way you did is correct. It works fine with that code: x is true.
probably you made a mistake somewhere else.
List ints = new List( new[] {1,5,7}); // 1
List intlist=new List() { 0,2,3,4,1}; // 2
var i = 5;
var x = ints.Contains(i); // return true or false