I have a util class like this:
public class Util
{
static public List<Person> PersonList{get;set;}
}
I want add Item to my list in Main method like this:
void Main()
{
Util.PersonList.Add(new Person{ Name="A" });
}
But it impossible …PersonList is null?
Add static constructor to your static class