Ejemplo n.º 1
0
            public IGremlinQuery <TTarget> As <TTarget>(Func <IGremlinQuery <TElement>, StepLabel <TElement>, IGremlinQuery <TTarget> > continuation)
            {
                var stepLabel = new StepLabel <TElement>();

                return(continuation(
                           this.As(stepLabel),
                           stepLabel));
            }
Ejemplo n.º 2
0
        internal static IGremlinQuery <T> AddStepLabelBinding <T>(this IGremlinQuery <T> query, Expression <Func <T, object> > memberExpression, StepLabel stepLabel)
        {
            var body = memberExpression.Body;

            if (body is UnaryExpression && body.NodeType == ExpressionType.Convert)
            {
                body = ((UnaryExpression)body).Operand;
            }

            if (!(body is MemberExpression memberExpressionBody))
            {
                throw new ArgumentException();
            }

            return(new GremlinQueryImpl <T>(query.TraversalSourceName, query.Steps, query.StepLabelMappings.SetItem(memberExpressionBody.Member.Name, stepLabel), query.IdentifierFactory));
        }
Ejemplo n.º 3
0
 public static IGremlinQuery <T> As <T>(this IGremlinQuery <T> query, StepLabel <T> stepLabel)
 {
     return(query
            .AddStep <T>("as", stepLabel));
 }
Ejemplo n.º 4
0
 public static IGremlinQuery <(T1, T2)> Select <T1, T2>(this IGremlinQuery query, StepLabel <T1> label1, StepLabel <T2> label2)
 {
     return(query
Ejemplo n.º 5
0
 public static IGremlinQuery <T> Select <T>(this IGremlinQuery query, StepLabel <T> label)
 {
     return(query
            .AddStep <T>("select", label));
 }
Ejemplo n.º 6
0
 public static IGremlinQuery <TSource> From <TSource, TStepLabel>(this IGremlinQuery <TSource> query, StepLabel <TStepLabel> stepLabel)
 {
     return(query
            .AddStep <TSource>("from", stepLabel));
 }
Ejemplo n.º 7
0
 public IGremlinQuery <TElement> As(StepLabel <TElement> stepLabel)
 {
     return(this
            .AddStep("as", stepLabel));
 }
Ejemplo n.º 8
0
 public IGremlinQuery <TStep> Select <TStep>(StepLabel <TStep> label)
 {
     return(this
            .AddStep <TElement, TStep>("select", label));
 }
Ejemplo n.º 9
0
 public IGremlinQuery <TElement> From <TStepLabel>(StepLabel <TStepLabel> stepLabel)
 {
     return(this
            .AddStep("from", stepLabel));
 }