Let's say I have a model class that looks like this:
public class ModelTest {
public string val1 {get;set;}
public string val2 {get;set;}
public string val3 {get;set;}
}
Somewhere in my code this ModelTest gets its data. The caveat is that, only 1 of them will hold a value
var model = new ModelTest() {val1=null, val2="value", val3=null} //Sudo code
What I am trying to do somehow, is compare a value to whichever 1 of the 3 items can potentially have a values, so something like:
var testCompare = "someValue"
if (testCompare == model. ....//how can I get the NOT NULL value from ModelTest here for comparison