FindAll
Example method FindAll.
Documentation
This example uses Oracle HR schema.
Code
Method that returns a list of your model and its relationships.
//Method that returns a list of your model and its relationships.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employees = ECRUD.FindAll<Employee>(DataBase.HR);
}
//Method that returns a list of your model and its relationships with constructor parameters.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employees = ECRUD.FindAll<Employee>(DataBase.HR, new object[] { "Willian" });
}
//Method that returns a list of your model and its relationships based on the specified condition (use table fields).
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employees = ECRUD.FindAll<Employee>("DEPARTMENT_ID = 60", DataBase.HR);
}
//Method that returns a list of your model and its relationships based on the specified condition (use table fields) with constructor parameters.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employees = ECRUD.FindAll<Employee>("DEPARTMENT_ID = 60", DataBase.HR, new object[] { "Willian" });
}
Code Async
Method that returns a list of your model and its relationships asynchronous.
//Method that returns a list of your model and its relationships.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employee = await ECRUD.FindAllAsync<Employee>(DataBase.HR);
}
//Method that returns a list of your model and its relationships with constructor parameters.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employee = await ECRUD.FindAllAsync<Employee>(DataBase.HR, new object[] { "Willian" });
}
//Method that returns a list of your model and its relationships based on the specified condition (use table fields).
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employee = await ECRUD.FindAllAsync<Employee>("DEPARTMENT_ID = 60", DataBase.HR);
}
//Method that returns a list of your model and its relationships based on the specified condition (use table fields) with constructor parameters.
using (var ECRUD = new ECRUD.OracleMapping())
{
var Employee = await ECRUD.FindAllAsync<Employee>("DEPARTMENT_ID = 60", DataBase.HR, new object[] { "Willian" });
}