public void BeforeDelete <TDocument>(string id, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { hook.BeforeDelete <TDocument>(id, map, transaction); } }
public void BeforeCommit(IWriteTransaction transaction) { foreach (var hook in hooks) { hook.BeforeCommit(transaction); } }
public void AfterCommit(IWriteTransaction transaction) { foreach (var hook in hooks) { hook.AfterCommit(transaction); } }
public void AfterUpdate <TDocument>(TDocument document, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { hook.AfterUpdate(document, map, transaction); } }
public void BeforeInsert <TDocument>(TDocument document, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { hook.BeforeInsert(document, map, transaction); } }
public async Task AfterDeleteAsync <TDocument>(object id, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { await hook.AfterDeleteAsync <TDocument>(id, map, transaction); } }
public async Task AfterCommitAsync(IWriteTransaction transaction) { foreach (var hook in hooks) { await hook.AfterCommitAsync(transaction); } }
public async Task BeforeDeleteAsync <TDocument>(string id, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { await hook.BeforeDeleteAsync <TDocument>(id, map, transaction); } }
public void AfterDelete <TDocument>(object id, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { hook.AfterDelete <TDocument>(id, map, transaction); } }
public void SaveData() { using (IWriteTransaction trans = _app.GetFileStorage(Ioc).OpenWriteTransaction(Ioc, _app.GetBooleanPreference(PreferenceKey.UseFileTransactions))) { DatabaseFormat.Save(KpDatabase, trans.OpenFile()); trans.CommitWrite(); } }
protected void UpdateRemoteFile(Stream cachedData, IOConnectionInfo ioc, bool useFileTransaction, string hash) { //try to write to remote: using ( IWriteTransaction remoteTrans = _cachedStorage.OpenWriteTransaction(ioc, useFileTransaction)) { Stream remoteStream = remoteTrans.OpenFile(); cachedData.CopyTo(remoteStream); remoteStream.Close(); remoteTrans.CommitWrite(); } //success. Update base-version of cache: File.WriteAllText(BaseVersionFilePath(ioc), hash); File.WriteAllText(VersionFilePath(ioc), hash); }
void InsertProductAndLineItems(string productName, decimal productPrice, IWriteTransaction trn, params int[] quantities) { var product = new Product { Name = productName, Price = productPrice }; trn.Insert(product); foreach (var quantity in quantities) { var lineItem = new LineItem { ProductId = product.Id, Name = "Some line item", Quantity = quantity }; trn.Insert(lineItem); } }
public ProcessPayment(IWriteTransaction writeTransaction) { _writeTransaction = writeTransaction; }
public void AfterUpdate <TDocument>(TDocument document, DocumentMap map, IWriteTransaction transaction) where TDocument : class => log.AppendLine(nameof(AfterUpdate));
public TransactionController(IReadBankAccount readBankAccount, IReadTransaction readTransaction, IWriteTransaction writeTransaction) { this._readBankAccount = readBankAccount; this._readTransaction = readTransaction; this._writeTransaction = writeTransaction; }
void IWriteInvokeCallback.ServerInvokeCallback(IWriteTransaction transaction, IMessageHandlerPublishBus bus) { Contract.Requires(transaction != null); Contract.Requires(bus != null); }
public void AfterCommit(IWriteTransaction transaction) => log.AppendLine(nameof(AfterCommit));
public void BeforeCommit(IWriteTransaction transaction) => log.AppendLine(nameof(BeforeCommit));
public void AfterDelete <TDocument>(string id, DocumentMap map, IWriteTransaction transaction) where TDocument : class => log.AppendLine(nameof(AfterDelete));
public void PopulateRelatedDocuments <TDocument>(IWriteTransaction transaction, TDocument instance) where TDocument : class { }
public void BeforeInsert <TDocument>(TDocument document, DocumentMap map, IWriteTransaction transaction) where TDocument : class => log.AppendLine(nameof(BeforeInsert));
public async Task BeforeUpdateAsync <TDocument>(TDocument document, DocumentMap map, IWriteTransaction transaction) where TDocument : class { foreach (var hook in hooks) { await hook.BeforeUpdateAsync(document, map, transaction); } }
public void BeforeDelete <TDocument>(object id, DocumentMap map, IWriteTransaction transaction) where TDocument : class => log.AppendLine(nameof(BeforeDelete));