Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

public class NameOf { public static String nameof(Expression> name) { MemberExpression expressionBody = (MemberExpression)name.Body; return expressionBody.Member.Name; } }

public class NameOf
    {
        public static String nameof<T>(Expression<Func<T>> name)
        {
            MemberExpression expressionBody = (MemberExpression)name.Body;
            return expressionBody.Member.Name;
        }
    }
 
PREVIOUS NEXT
Tagged: #public #class #NameOf #public #static #String #MemberExpression #expressionBody #return
ADD COMMENT
Topic
Name
7+8 =