Example #1
0
        /// <summary>
        /// The get path.
        /// </summary>
        /// <param name="expression">
        /// The expression.
        /// </param>
        /// <typeparam name="T">
        /// </typeparam>
        /// <returns>
        /// The <see cref="MemberExpression[]"/>.
        /// </returns>
        public static IReadOnlyList <MemberInfo> GetPath <T>(Expression <Func <T> > expression)
        {
            var visitor = new PropertyPathVisitor(expression);

            visitor.Visit(expression);
            visitor.path.Reverse();
            return(visitor.path);
        }