In such cases, I use the extension method
public static bool In<T>(this T source, params T[] list) { if (source = null) throw new NullReferenceException("Source is Null"); return list.Contains(source); }
and name him
if (model.PartitionKey.Substring(2, 2).In("05", "06"))
Being an extension method, we can call it for all types, such as
if(myintegervariable.In(3, 4));
OR
if(mybytevariable.In(23, 56, 34, 43, 87, 155));
source share