Documentation

This example uses Oracle HR schema.

Code

Method that returns a list of your model model.

//Method that returns a list of your model based on custom query.
using (var ECRUD = new ECRUD.OracleMapping())
{
    StringBuilder sbQuery = new StringBuilder();

    sbQuery.Append("SELECT * ");
    sbQuery.Append("  FROM HR.EMPLOYEES ");
    sbQuery.Append("WHERE  1 = 1 ");
    sbQuery.Append("  AND JOB_ID = 'IT_PROG'");

    var lstEmployee = ECRUD.QueryMapperToObjectList<Employee>(sbQuery.ToString(), DataBase.HR);
}

Code Async

Method that returns a list of your model model asynchronous.

//Method that returns a list of your model based on custom query.
using (var ECRUD = new ECRUD.OracleMapping())
{
    StringBuilder sbQuery = new StringBuilder();

    sbQuery.Append("SELECT * ");
    sbQuery.Append("  FROM HR.EMPLOYEES ");
    sbQuery.Append("WHERE  1 = 1 ");
    sbQuery.Append("  AND JOB_ID = 'IT_PROG'");

    var lstEmployee = await ECRUD.QueryMapperToObjectListAsync<Employee>(sbQuery.ToString(), DataBase.HR);
}