Beispiel #1
0
        public static IProjectDynamicBuilder <TSourceQuery, TElement> By <TSourceQuery, TElement>(this IProjectDynamicBuilder <TSourceQuery, TElement> projectBuilder, Expression <Func <TElement, object> > projection)
            where TSourceQuery : IElementGremlinQueryBase <TElement>
        {
            if (projection.Body.StripConvert() is MemberExpression memberExpression)
            {
                return(projectBuilder.By(memberExpression.Member.Name, projection));
            }

            throw new ExpressionNotSupportedException(projection);
        }
Beispiel #2
0
 public static IProjectDynamicBuilder <TSourceQuery, TElement> By <TSourceQuery, TElement>(this IProjectDynamicBuilder <TSourceQuery, TElement> projectBuilder, string name, Expression <Func <TElement, object> > projection)
     where TSourceQuery : IElementGremlinQueryBase <TElement>
 {
     return(projectBuilder.By(name, _ => _.Values(projection)));
 }