/// <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}"); } }
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(); }; }
/// <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); } }
/// <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; } }
public void Register(ICommittable participant) { _participants.Add(participant); }