private Query Query(string tableName = "user")
        {
            var connection = connectionProvider.GetOpenedConnection();
            var db         = new QueryFactory(connection, new MySqlCompiler())
            {
                Logger = LogQuery
            };

            return(db.Query(tableName));
        }
예제 #2
0
        public async Task <T> Run <T>(Func <Task <T> > action, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
        {
            var connection = connectionProvider.GetOpenedConnection();

            await using DbTransaction transaction = await connection.BeginTransactionAsync(isolationLevel);

            var result = await action();

            await transaction.CommitAsync();

            return(result);
        }