I need a seperate class where I want to add to some Lists anytime I set a new value. Using _name.Add(value) within the set method doesn't work.
I tried the following
public class XMLInformation
{
public String BusType
{
get
{
return SubBusType.LastOrDefault();
}
set
{
SubBusType.Add(value);
}
}
public List<string> SubBusType { get; set; }
}
I use it like this:
public STARC.GlobalVariables.XMLInformation XMLInformation = new STARC.GlobalVariables.XMLInformation();
XMLInformation.BusType = "Test";
now i get an error message (sorry error is partly in geeman)
What am I doing wrong?