Syntax for checking multiple conditions in an 'if' statement

c#

Solution

Or perhaps

var accepted = new HashSet<int>(new[] {1, 5, 7, 8, 9, 10});

@if (accepted.Contains(item.TotalImages))
{
   string mystring = "string one"
}

Problem

This is situation: ``` if count items is either 0,1,5,7,8,9,10 then string = "string one" if count items is either 2,3,4 then string = "string two" ``` I tried with (inside cs razor view) ``` @if (@item.TotalImages == 1 || 5 || 7 || 8 || 9 || 10) { string mystring = "string one" } ``` but I'm getting this error operator || cannot be applied to operands of type bool or int

Original source