Exemple #1
0
        public async Task UpdateContactAsync(Contact contact)
        {
            using (var connection = _database.GetDbConnection())
            {
                connection.EnsureConnectionOpen();

                var sql = _contactsQueryBuilder.CreateUpdateContactQuery(contact);

                await _dbExecutor.ExecuteAsync(connection, sql).ConfigureAwait(false);
            }
        }
Exemple #2
0
 public static Task <int> ExecuteAsync(this IDbExecutor <IDbConnection> executor, string sql, object?param = null)
 => executor.ExecuteAsync(connection => connection.ExecuteAsync(sql, param));
Exemple #3
0
 public static Task <IEnumerable <T> > QueryAsync <T>(this IDbExecutor <IDbConnection> executor, Sql sql)
 => executor.ExecuteAsync(connection => connection.QueryAsync <T>(sql));
Exemple #4
0
 public static Task <int> ExecuteAsync(this IDbExecutor <IDbConnection> executor, Sql sql)
 => executor.ExecuteAsync(connection => connection.ExecuteAsync(sql));
Exemple #5
0
 public static Task <T> QuerySingleAsync <T>(this IDbExecutor <IDbConnection> executor, string sql, object?param = null)
 => executor.ExecuteAsync(connection => connection.QuerySingleAsync <T>(sql, param));
Exemple #6
0
 public static Task <List <T> > QueryListAsync <T>(this IDbExecutor <IDbConnection> executor, Sql sql)
 => executor.ExecuteAsync(connection => connection.QueryListAsync <T>(sql));
Exemple #7
0
 public static Task <T[]> QueryArrayAsync <T>(this IDbExecutor <IDbConnection> executor, Sql sql)
 => executor.ExecuteAsync(connection => connection.QueryArrayAsync <T>(sql));
Exemple #8
0
 public static Task <T> QueryFirstOrDefaultAsync <T>(this IDbExecutor <IDbConnection> executor, Sql sql)
 => executor.ExecuteAsync(connection => connection.QueryFirstOrDefaultAsync <T>(sql));
 public static Task <TKey> InsertAsync <TKey>(this IDbExecutor <IDbConnection> executor, object param)
 => executor.ExecuteAsync(connection => connection.InsertAsync <TKey>(param));
 public static Task <T> GetByKeyAsync <T>(this IDbExecutor <IDbConnection> executor, object param)
 => executor.ExecuteAsync(connection => connection.GetByKeyAsync <T>(param));
 public static Task <int> DeleteAsync <T>(this IDbExecutor <IDbConnection> executor, object param)
 => executor.ExecuteAsync(connection => connection.DeleteAsync <T>(param));
 public static Task <int> UpdateAsync(this IDbExecutor <IDbConnection> executor, object param)
 => executor.ExecuteAsync(connection => connection.UpdateAsync(param));