Пример #1
0
        /// <summary>
        ///     Called to build the child nodes.
        /// </summary>
        /// <param name="idPointer">The id pointer.</param>
        /// <param name="baseNode">The base node.</param>
        public void Children(
            IdPointer idPointer,
            BaseNode <TNew, TDb, TKey, TUserId> baseNode)
        {
            foreach (var oneNode in manyToOneNodes)
            {
                baseNode.AddManyToOne(oneNode.Build(idPointer));
            }

            foreach (var manyNode in manyToManyNodes)
            {
                baseNode.AddManyToMany(manyNode.Build(idPointer));
            }
        }
Пример #2
0
        /// <summary>
        ///     Called on the root to build the root node.
        /// </summary>
        /// <returns>Returns the root node.</returns>
        public (RootNode <TNew, TDb, TKey, TUserId>, int) Build()
        {
            var id   = new IdPointer();
            var node = new RootNode <TNew, TDb, TKey, TUserId>(
                id.Id++,
                this.immutable,
                this.diffRepository,
                this.updateValues);

            this.Children(
                id,
                node);
            return(node, id.Id);
        }
Пример #3
0
            public IUpdateManyToOne <TNew, TDb, TKey, TUserId> Build(IdPointer id)
            {
                var updateManyToOne = new UpdateManyToOne <TNew, TDb, TNewProp, TDbProp, TKey, TChildKey, TUserId>(
                    id.Id++,
                    DiffDsl.immutable,
                    NewProp,
                    dbValue,
                    DiffDsl.updateValues,
                    DiffDsl.diffRepository);

                DiffDsl.Children(
                    id,
                    updateManyToOne);
                return(updateManyToOne);
            }
Пример #4
0
            public IUpdateManyToMany <TNew, TDb, TKey, TUserId> Build(IdPointer id)
            {
                var updateManyToMany = new UpdateManyToMany <
                    TNew,
                    TDb,
                    TNewProp,
                    TDbProp,
                    TKey,
                    TChildKey,
                    TUserId>(
                    id.Id++,
                    DiffDsl.immutable,
                    this.NewPropKey,
                    this.NewProp,
                    this.DbValue,
                    this.DiffDsl.updateValues,
                    this.SetParent,
                    this.DiffDsl.diffRepository);

                DiffDsl.Children(
                    id,
                    updateManyToMany);
                return(updateManyToMany);
            }