Ejemplo n.º 1
0
        public async Task <int> EasyInsertAsync <T>(T data) where T : class
        {
            await EnsureOpenAsync();

            EnsureDapperTypeMapping(typeof(T));

            return(await SqlMapperExtensions.InsertAsync <T>(Connection, data, Transaction));
        }
Ejemplo n.º 2
0
 public async Task Create(T entity)
 {
     await SqlMapperExtensions.InsertAsync(_connection, entity);
 }
Ejemplo n.º 3
0
 public async Task <long> SaveAsync(TEntity entity)
 {
     using (var sqlConnection = new SqlConnection(DbConstant.DatabaseConnection))
         return(await SqlMapperExtensions.InsertAsync(sqlConnection, entity));
 }
Ejemplo n.º 4
0
 public async Task <int> InsertAsync(IEnumerable <TEntity> entities, ISqlAdapter sqlAdapter = null)
 {
     return(await SqlMapperExtensions.InsertAsync(_connection, entities, _transaction, _commandTimeout, sqlAdapter));
 }
Ejemplo n.º 5
0
 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));
 }