Find
Example method Find.
Documentation
This example uses Oracle HR schema.
Code
Method that returns a model.
//Method that returns a 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 EMPLOYEE_ID = '200'");
var Employee = ECRUD.QueryMapperToObject<Employee>(sbQuery.ToString(), DataBase.HR);
}
Code Async
Method that returns a model asynchronous.
//Method that returns a 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 EMPLOYEE_ID = '200'");
var Employee = await ECRUD.QueryMapperToObjectAsync<Employee>(sbQuery.ToString(), DataBase.HR);
}