I am using a class that has a member of another class (all of the members are strings), and when I try to set a value I get a null reference exception. Can anyone help me? I'm still kind of new to classes.
Here are my two classes:
public class MergeFields
{
public string FNAME { get; set; }
public string LNAME { get; set; }
public string CITY { get; set; }
public string STATE { get; set; }
}
public class Member
{
public string email_Address { get; set; }
public string status { get; set; }
public MergeFields merge_fields { get; set; }
}
And here is where I set the value of CITY:
Member Person = new Member();
string cityTest = "New York";
person.merge_fileds.CITY = cityTest; //This is where I get the exception
Am I missing something stupid obvious? Or is this just not possible?