What is the best way for me to check for null values so I don’t get an error when this statement executes:
if (Levels.Count(x => x.Location.ToUpper() == code.ToUpper()) == 1)
I need to make sure Location is not null because it keeps throwing an object reference exception.
You can try with
Whereoperator