public User(string name, string account, int age, List <string> roles, DateTime birthday, ClassModel classInfo) { //模拟耗时操作 CoreService.CostTime(5); this.Name = name; this.Account = new StringBuilder(account); this.Age = age; this.Roles = roles; this.Birthday = birthday; this.ClassInfo = classInfo; Console.WriteLine("User被构造了"); }
public User() { //模拟耗时操作 CoreService.CostTime(5); Console.WriteLine("User被无参构造了"); }