예제 #1
0
 protected async Task <int?> InsertAsync <TEntity>(TEntity entity, IDbTransaction transaction = null, int?commandTimeout = null) where TEntity : class
 {
     using (IDbConnection connection = new Npgsql.NpgsqlConnection(this.connectionString))
     {
         try
         {
             connection.Open();
             return((int?)(await connection.InsertAsync(entity, transaction, commandTimeout)));
         }
         catch (Exception exc)
         {
             Console.WriteLine(exc.Message);
             throw exc;
         }
     }
 }