我有一个基类Sport
定义为:
public class Sport
{
public int Id {get; set;}
public string Name {get; set;}
public Sport() {}
public override string ToString()
{
string objectState = string.Format("[Id: {0}; Name: {1};]", Id, Name);
return objectState;
}
}
我有第二个继承类的Sport
类:
public class Basketball : Sport
{
public string PointTerm {get; set;}
public Basketball() {}
//overriding ToString()??
}
如何ToString
使用附加属性覆盖我的基础 Sport 类PointTerm
?