Пример #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));
            }
Пример #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));
        }
Пример #3
0
 public static IGremlinQuery <T> As <T>(this IGremlinQuery <T> query, StepLabel <T> stepLabel)
 {
     return(query
            .AddStep <T>("as", stepLabel));
 }
Пример #4
0
 public static IGremlinQuery <(T1, T2)> Select <T1, T2>(this IGremlinQuery query, StepLabel <T1> label1, StepLabel <T2> label2)
 {
     return(query
Пример #5
0
 public static IGremlinQuery <T> Select <T>(this IGremlinQuery query, StepLabel <T> label)
 {
     return(query
            .AddStep <T>("select", label));
 }
Пример #6
0
 public static IGremlinQuery <TSource> From <TSource, TStepLabel>(this IGremlinQuery <TSource> query, StepLabel <TStepLabel> stepLabel)
 {
     return(query
            .AddStep <TSource>("from", stepLabel));
 }
Пример #7
0
 public IGremlinQuery <TElement> As(StepLabel <TElement> stepLabel)
 {
     return(this
            .AddStep("as", stepLabel));
 }
Пример #8
0
 public IGremlinQuery <TStep> Select <TStep>(StepLabel <TStep> label)
 {
     return(this
            .AddStep <TElement, TStep>("select", label));
 }
Пример #9
0
 public IGremlinQuery <TElement> From <TStepLabel>(StepLabel <TStepLabel> stepLabel)
 {
     return(this
            .AddStep("from", stepLabel));
 }