4. IList<T> GetCollection(string query)

Returns all objects in the database for the specified type, filtered with the specified query. It does not load any children for the objects. For that, use GetCollectionWithChildren();

Note

The query can be SQL or OQL (OQL is still under development).

Example:

IObjectMapper<Customer> mapper = Elementary.GetIObjectMapper<Customer>();

// Get all customers whose last name starts with "G"
IList<Customer> customers = mapper.GetCollection("LastName LIKE 'G%'");

Console.WriteLine(customers[0].Orders); // Orders is null