Here with generics:
public static string ToString<T>(this T obj, Func<T, string> toStringFunction)
{
return toStringFunction(obj);
}
You can use it like this:
Console.WriteLine(person.ToString(p=>p.Name));
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.