I have a method that returns an object. If I return an object then it will give a fully qualified name of the class. But I want to return the data members of the object.
public GetDetails GetInfo()
{
GetDetails detail = new GetDetails("john", 47);
return detail;
}
public override string ToString()
{
return this.Name + "|" + this.Age;
}
I override the ToString()
method to get the data member of detail
object. But it is not working. How can I achieve that?