how to use a list as a property

Mar 8 2010 12:58 AM
This little bit of code wasn't working for me.  I was wondering the proper way to use a list as a property, instead of setting it as a public member.
Class Company
{
   ..
   private list<string> employees{get; set;}
   ..
}

..
..// in main.
  Company myCompany = new Company();
  myCompany.employees.add("jim");    // doesn't work
  myCompany.employees.add("sue");   // doesn't work
 


 Thank you much.

Answers (5)