return new Employee{FirstName=firstName,LastName=lastName};是什么用法public class Employee{ public static Employee CreateEmployee(string firstName,string lastName){ return new Employee{FirstName=firstName,LastName=lastName};}public string FirstN

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/24 18:42:41
return new Employee{FirstName=firstName,LastName=lastName};是什么用法public class Employee{ public static Employee CreateEmployee(string firstName,string lastName){ return new Employee{FirstName=firstName,LastName=lastName};}public string FirstN
x)+J-)-SK-Wp-ɯLMv,*.KMMt|B9PFnx6O-(MLVH*(F..I,R0qĒTW(3/]aTff.;l(DMR>6ke$BH 6(!TSZb] TLDS!m lF|zO|qӎOw?t ۟ ً۟7hh~g~qAb8*z

return new Employee{FirstName=firstName,LastName=lastName};是什么用法public class Employee{ public static Employee CreateEmployee(string firstName,string lastName){ return new Employee{FirstName=firstName,LastName=lastName};}public string FirstN
return new Employee{FirstName=firstName,LastName=lastName};是什么用法
public class Employee
{
public static Employee CreateEmployee(string firstName,string lastName)
{
return new Employee{FirstName=firstName,LastName=lastName};
}
public string FirstName{get;set;}
public string LastName{get;set;}
}

return new Employee{FirstName=firstName,LastName=lastName};是什么用法public class Employee{ public static Employee CreateEmployee(string firstName,string lastName){ return new Employee{FirstName=firstName,LastName=lastName};}public string FirstN
这叫对象初始化器,具体用法请参考: