Learner Learner - 10 months ago 45
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") };