PetShop3.0的Model中public AddressInfo(string firstName, string lastName) {
this._firstName = firstName;
this._lastName = lastName;
.........
}// Properties
public string FirstName {
get { return _firstName; }
set { _firstName = value; }
}public string LastName {
get { return _lastName; }
set { _lastName = value; }
}//为什么要写成这样?不直接写成public的get和set方法?请问这样做有什么好处?
this._firstName = firstName;
this._lastName = lastName;
.........
}// Properties
public string FirstName {
get { return _firstName; }
set { _firstName = value; }
}public string LastName {
get { return _lastName; }
set { _lastName = value; }
}//为什么要写成这样?不直接写成public的get和set方法?请问这样做有什么好处?
种行动,有副作用