Example #1
0
        /// <summary>
        /// Get the root of this expression (what would be the leftmost expression on generated code).
        /// </summary>
        /// <param name="expression"></param>
        /// <exception cref="ArgumentException">If this or one expressions on the left of this can't have a target object</exception>
        /// <returns></returns>
        public static CodeExpression GetFluentRoot(this CodeExpression expression)
        {
            CodeExpression current = expression;

            for (; current.GetFluentParent() != null; current = current.GetFluentParent())
            {
            }
            return(current);
        }
Example #2
0
        private static IEnumerable <CodeExpression> GetFluentCallsImpl(CodeExpression expression)
        {
            CodeExpression current = expression;

            for (; current.GetFluentParent() != null; current = current.GetFluentParent())
            {
                yield return(current);
            }
            yield return(current);
        }