I have one list that contains just ids
var listVal = new List<int>() { 1,2,3,4 };
another foreach
if (page.Id == 1 || page.Id == 2 || page.Id == 3 || page.Id == 4 )
Looking for a way to dynamically generate that if statement from the list listVal above or a better way to do this. Very new to C#
Not finding a way to do this.
>Solution :
if (listVal.Contains(page.Id)) {
Console.Write("Ta-daa!");
}