I have the following:
if (model.PartitionKey.Substring(2, 2) == \"05\" ||
model.PartitionKey.Substring(2, 2) == \"06\")
I have more like t
You can save the substring in a variable:
var substring = model.PartitionKey.Substring(2, 2);
if (substring == "05" || substring == "06")
Or you could use a regular expression:
if (Regex.IsMatch("^..0[56]", model.PartitionKey))
This probably depends a bit on how easily you can understand a regex while reading code.