protected bool Delete <TEntity>(TEntity entity, IDbTransaction transaction = null, int?commandTimeout = null) where TEntity : class { using (IDbConnection connection = new Npgsql.NpgsqlConnection(this.connectionString)) { try { connection.Open(); return(connection.Delete(entity, transaction, commandTimeout)); } catch (Exception exc) { Console.WriteLine(exc.Message); throw exc; } } }