public static async Task RunInWrappedTransactionAsync(this SQLiteAsyncConnection asyncDb, Action <SQLiteConnectionWrapper> action) { SQLiteConnectionWrapper connectionWrapper = null; Action <SQLiteConnection> wrappedAction = db => { connectionWrapper = Kimchi.CreateConnectionWrapper(db); action(connectionWrapper); }; try { await asyncDb.RunInTransactionAsync(wrappedAction); connectionWrapper.Commit(); } catch (Exception e) { connectionWrapper.Rollback(e); } }
public virtual void AfterUpdate(SQLiteConnectionWrapper db) { // Usually we want to do the same thing on insert and on update AfterInsert(db); }
public virtual void AfterLoad(SQLiteConnectionWrapper db) { // do nothing }
public virtual void BeforeInsert(SQLiteConnectionWrapper db) { // do nothing }