コード例 #1
0
        /// <inheritdoc />
        public ICommittableOffsetBatch Updated(ICommittable offset)
        {
            switch (offset)
            {
            case ICommittableOffset committableOffset:
                return(UpdateWithOffset(committableOffset));

            case ICommittableOffsetBatch committableOffsetBatch:
                return(UpdateWithBatch(committableOffsetBatch));

            default:
                throw new AggregateException($"Unexpected offset to update committable batch offsets from: {offset.GetType().Name}");
            }
        }
コード例 #2
0
ファイル: Dao.cs プロジェクト: ThreeHeadz/Bam.Net
        protected internal void WriteChildCommits(SqlStringBuilder sql, Database db = null)
        {
            db = db ?? Database;
            foreach (string key in this.ChildCollections.Keys)
            {
                ICommittable c = this.ChildCollections[key];
                c.WriteCommit(sql, db);
            }

            sql.Executed += (s, d) =>
            {
                this.ChildCollections.Clear();
            };
        }
コード例 #3
0
        /// <summary>
        /// You should never call this directly, EntitySpaces calls this internally.
        /// </summary>
        /// <param name="commit">Any class that implements ICommittable</param>
        /// <returns>True if successful</returns>
        static public bool AddForCommit(ICommittable commit)
        {
            esTransactionScope current = GetCurrentTx();

            if (current != null)
            {
                if (current.commitList == null)
                {
                    current.commitList = new List <ICommittable>();
                }

                current.commitList.Add(commit);

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #4
0
        /// <summary>
        /// You should never call this directly, EntitySpaces calls this internally.
        /// </summary>
        /// <param name="commit">Any class that implements ICommittable</param>
        /// <returns>True if successful</returns>
        static public bool AddForCommit(ICommittable commit)
        {
            esTransactionScope current = GetCurrentTx();
            if (current != null)
            {
                if (current.commitList == null)
                {
                    current.commitList = new List<ICommittable>();
                }

                current.commitList.Add(commit);

                return true;
            }
            else
            {
                return false;
            }

        }
コード例 #5
0
 public void Register(ICommittable participant)
 {
     _participants.Add(participant);
 }