I wrote an extension method for strings which I'm using for logging the name, the value and the "source" of the string which calls the method. Source meens from which class or methods comes the string. For example Program.Main() or ClasXY.ToString() ... It looks like this
public static void LogMe(this string str, string memberName, string methodName)
{
WriteToLog(DateTime.Now, memberName, methodName, str);
}
Is it possible to get the name and the source of the string directly from the string object in my extension method? Something like this
public static void LogMe(this string str)
{
string memberName = str.myName;
string methodName = str. mySource;
WriteToLog(DateTime.Now, memberName, methodName, str);
}