class person
{
[Required(ErrorMessage = "Please enter the FirstName of person")]
string FirstName{get; set ;}
[Required(ErrorMessage = "Please enter the LastName of person")]
string LastName{get; set ;}
}
class Student
{
string FirstName{get; set ;}
string LastName{get; set ;}
}
Person p = new Person();
Student s = new Student();
我想将属性从复制person
到Student
;怎么可能?