Exemple #1
0
 private Create(TypeExpr token, GraphClass graphClass, OrientSqlExpr @from, OrientSqlExpr @to, OrientSqlExpr set)
 {
     _token      = token;
     _graphClass = graphClass;
     _from       = @from;
     _to         = to;
     _set        = set;
 }
        public CreateEdgeMutation(T edge, V @from, V to, List <IGraphMutation> mutations, IdentifierFactory factory) : this(edge, factory)
        {
            var f = mutations.FirstOrDefault(p => p.GraphItem == @from)?.Identifier;
            var t = mutations.FirstOrDefault(p => p.GraphItem == to)?.Identifier;

            _query = (@from?.Rid, to?.Rid, f, t) switch
            {
                (string fromV, string toV, _, _) =>
                new Let(
                    new Create(new Edge(), new GraphClass(Item.GetType()), new From(new Rid(fromV)), new To(new Rid(toV)), GetSetter()), Identifier),
                (null, string toV, Identifier fV, _) =>
                new Let(
                    new Create(new Edge(), new GraphClass(Item.GetType()), new From(fV), new To(new Rid(toV)), GetSetter()), Identifier),
                (string fromV, null, _, Identifier tV) =>
                new Let(
                    new Create(new Edge(), new GraphClass(Item.GetType()), new From(new Rid(fromV)), new To(tV), GetSetter()), Identifier),
                (null, null, Identifier fV, Identifier tV) =>
                new Let(
                    new Create(new Edge(), new GraphClass(Item.GetType()), new From(fV), new To(tV), GetSetter()), Identifier),
                _ => throw new InvalidOperationException()
            }
            ;
        }
Exemple #3
0
 private Let(Identifier identifier, OrientSqlExpr expr)
 {
     _identifier = identifier;
     _expr       = expr;
 }
Exemple #4
0
 private To(OrientSqlExpr expr)
 {
     _expr = expr;
 }