Learner Learner - 1 year ago 65
ASP.NET (C#) Question

constructor of nType hits on creating a List<nType> object?

I am just curious if the line below hits the constructor of Employee on execution of this line?

List<Employee> exmployees = new List<Employee>();

Answer Source

Are you looking for this?

Employee = new List<Employee>(){ new Employee("1")//Here constructor get called, 
                                            new Employee("12"),
                                            new Employee("123") };
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download