I have created an extension method:
public static class Validation
{
public static bool ValidateEMail(this String str)
{
return Regex.Match(str, @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*").Success;
}
}
I can call this method as:
bool result = EMailId.ValidateEMail()
My Question is: Can I get the property name of the caller of this extension method within my extension method so that I can do additional operation on that property name? In this case, can I get the name "EmailId" within "ValidateEMail"
Thanks