public async Task <int> EasyInsertAsync <T>(T data) where T : class { await EnsureOpenAsync(); EnsureDapperTypeMapping(typeof(T)); return(await SqlMapperExtensions.InsertAsync <T>(Connection, data, Transaction)); }
public async Task Create(T entity) { await SqlMapperExtensions.InsertAsync(_connection, entity); }
public async Task <long> SaveAsync(TEntity entity) { using (var sqlConnection = new SqlConnection(DbConstant.DatabaseConnection)) return(await SqlMapperExtensions.InsertAsync(sqlConnection, entity)); }
public async Task <int> InsertAsync(IEnumerable <TEntity> entities, ISqlAdapter sqlAdapter = null) { return(await SqlMapperExtensions.InsertAsync(_connection, entities, _transaction, _commandTimeout, sqlAdapter)); }
public async Task <int> InsertAsync(TEntity entityToInsert, ISqlAdapter sqlAdapter = null) { return(await SqlMapperExtensions.InsertAsync(_connection, entityToInsert, _transaction, _commandTimeout, sqlAdapter)); }
public static Task <int> InsertAsync <T>(this IDbConnection connection, T entityToInsert, bool enumAsString = false, IDbTransaction transaction = null, int?commandTimeout = null, ISqlAdapter sqlAdapter = null) where T : class { return(enumAsString ? InsertWithEnumAsStringAsync(connection, entityToInsert) : SqlMapperExtensions.InsertAsync(connection, entityToInsert, transaction, commandTimeout, sqlAdapter)); }