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); }
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))); }