LiteX.DbHelper.Oracle 1.0.0

This is a tiny library helps write less code, to execute queries and stored procedures against Oracle database as like any normal CLR method.
     It is just written for the purpose to bring a new level of ease to the developers who deal with ADO.NET for data access.
    
     LiteXDbHelper is simple and tiny yet powerful and very high-performance library to working with ADO.NET.

There is a newer version of this package available.
See the version list below for details.
Install-Package LiteX.DbHelper.Oracle -Version 1.0.0
dotnet add package LiteX.DbHelper.Oracle --version 1.0.0
<PackageReference Include="LiteX.DbHelper.Oracle" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LiteX.DbHelper.Oracle --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Features

Basic features
  • ExecuteNonQuery
  • ExecuteScalar
  • GetDataTable
  • GetDataSet
  • ExecuteReder
  • CreateParameters (for each providers)
Advanced features (Coming soon)
  • ExecuteScalar<>
  • GetSingle<T>
  • GetList<T>
  • GetArray<T>
  • GetDictionary<TKey, TValue>

Instantiate the DBHelper:

...
// just use the connection string name
IDBHelper dbHelper = new OracleHelper("MyCN");
// use different provider class based on your database.

Basic ADO.NET methods:

// Create parameters
var paramResultOut = DbHelper.CreateOutParameter("@Result", SqlDbType.NVarChar, 100);
var paramIsActive = DbHelper.CreateParameter("@IsActive", isActive);
var paramId = DbHelper.CreateParameter("@Id", id);

  
// ExecuteNonQuery
// Stored procedure
var count = _dbHelper.ExecuteNonQuery("DeleteCountry", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var count = _dbHelper.ExecuteNonQuery("DELETE FROM [dbo].[Country] WHERE Id = @Id", CommandType.Text, paramIsActive);


// ExecuteScalar - returning a object type scalar value 
var name = _dbHelper.ExecuteScalar("SELECT Name FROM COUNTRY");


// DataReader
// Stored procedure
var dataReader = _dbHelper.ExecuteReder("GetCountries", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var dataReader = _dbHelper.ExecuteReder("SELECT * FROM Country WHERE IsActive = @IsActive", CommandType.Text, paramIsActive);


// DataTable
// Stored procedure
var dataTable = _dbHelper.GetDataTable("GetCountries", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var dataTable = _dbHelper.GetDataTable("SELECT * FROM Country WHERE IsActive = @IsActive", CommandType.Text, paramIsActive);


// DataSet
// Stored procedure
var dataSet = _dbHelper.GetDataSet("GetCountriesAndStates", paramIsActive, paramResultOut);

Features

Basic features
  • ExecuteNonQuery
  • ExecuteScalar
  • GetDataTable
  • GetDataSet
  • ExecuteReder
  • CreateParameters (for each providers)
Advanced features (Coming soon)
  • ExecuteScalar<>
  • GetSingle<T>
  • GetList<T>
  • GetArray<T>
  • GetDictionary<TKey, TValue>

Instantiate the DBHelper:

...
// just use the connection string name
IDBHelper dbHelper = new OracleHelper("MyCN");
// use different provider class based on your database.

Basic ADO.NET methods:

// Create parameters
var paramResultOut = DbHelper.CreateOutParameter("@Result", SqlDbType.NVarChar, 100);
var paramIsActive = DbHelper.CreateParameter("@IsActive", isActive);
var paramId = DbHelper.CreateParameter("@Id", id);

  
// ExecuteNonQuery
// Stored procedure
var count = _dbHelper.ExecuteNonQuery("DeleteCountry", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var count = _dbHelper.ExecuteNonQuery("DELETE FROM [dbo].[Country] WHERE Id = @Id", CommandType.Text, paramIsActive);


// ExecuteScalar - returning a object type scalar value 
var name = _dbHelper.ExecuteScalar("SELECT Name FROM COUNTRY");


// DataReader
// Stored procedure
var dataReader = _dbHelper.ExecuteReder("GetCountries", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var dataReader = _dbHelper.ExecuteReder("SELECT * FROM Country WHERE IsActive = @IsActive", CommandType.Text, paramIsActive);


// DataTable
// Stored procedure
var dataTable = _dbHelper.GetDataTable("GetCountries", paramIsActive, paramResultOut);
// OR
// Raw sql commnad
var dataTable = _dbHelper.GetDataTable("SELECT * FROM Country WHERE IsActive = @IsActive", CommandType.Text, paramIsActive);


// DataSet
// Stored procedure
var dataSet = _dbHelper.GetDataSet("GetCountriesAndStates", paramIsActive, paramResultOut);

Release Notes

ADO.NET methods - ExecuteNonQuery, ExecuteScalar, GetDataTable, GetDataSet, ExecuteReder, CreateParameter
     Coming soon - Advanced features - Strongly type result and more APIs
     Coming soon - Async methods support
     Comimg soon - OUT parameter support in stored procedure
     Coming soon - Ping (useful in health check and load balancing)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 38 9/19/2019
1.0.0 469 7/14/2019