protected UpdateMutation(T item, IdentifierFactory identifierFactory) : base(item, identifierFactory)
 {
     if (item.IsNew())
     {
         throw new ArgumentException(nameof(item));
     }
     Sets = new List <Action <T> >();
 }
 public DeleteEdgeMutation(T item, IdentifierFactory identifierFactory) : base(item, identifierFactory)
 {
 }
Exemple #3
0
 protected GraphMutation(T item, IdentifierFactory identifierFactory)
 {
     Item       = item;
     Identifier = identifierFactory.GetIdentifier(item.GetType().Name);
 }
        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 #5
0
 public UpdateEdgeMutation(T item, IdentifierFactory identifierFactory) : base(item, identifierFactory)
 {
     _update = new Update(new Edge(), new Rid(item.Rid), new Set(null));
 }
Exemple #6
0
 public MutableGraph(ReadonlyGraph graph)
 {
     _graph     = graph;
     _mutations = new List <IGraphMutation>();
     _factory   = new IdentifierFactory();
 }
 public CreateVertexMutation(T item, IdentifierFactory identifierFactory) : base(item, identifierFactory)
 {
 }