Hi,
You can find several ways
as Per me something like as follows:
public interface IStringable
{
string ToString();
}
public class Stringable : IStringable
{
public string ToString()
{
return this.GetType().FullName;
}
}
Another way
public static class ExtentionBase
{
public static string ToString(this Object Obj)
{
if(Obj is IStringable)
return ((IStringable)Obj).ToString();
else
return Obj.GetType().FullName;
}
}