I define a class comprising of a list of strings and try to initialise the object but I get an error "object reference not set to an instance of an object"
Here is the code defining the class
public class TopClass
{
public List<string> Stringlist { get; set; }
}
then I try to add data to the list and get the "object reference not set to an instance of an object".
TopClass topClass = new TopClass();
topClass.Stringlist.Add("house");
What could I be doing wrong?