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);
            }
        }
Exemple #2
0
 public virtual void AfterUpdate(SQLiteConnectionWrapper db)
 {
     // Usually we want to do the same thing on insert and on update
     AfterInsert(db);
 }
Exemple #3
0
 public virtual void AfterLoad(SQLiteConnectionWrapper db)
 {
     // do nothing
 }
Exemple #4
0
 public virtual void BeforeInsert(SQLiteConnectionWrapper db)
 {
     // do nothing
 }