...
A product can use either custom SQL or retrieve data with Quino and apply aggregations locally with .NET Linq.
Custom SQL
Quino provides several ways of integrating SQL into a query.
...
ICustomCommandBuilder
: A high-level API to build custom/parameterized SQL
...
IQuery.CustomCommandText
: A low-level API to replace or extend parts of a query
Using ADO: Get access to the underlying ADO driver for the database
...
The ADO.NET layer can be accessed via the following methods:
Code Block | ||
---|---|---|
| ||
Session.GetAdoConnection();
Session.GetAdoCommand(); |
A custom query can be mapped to an existing MetaClass as well:
Code Block | ||
---|---|---|
| ||
var command = Session.GetAdoCommand();
command.CommandText = "Select * from \"Sandbox__Company\"";
var list = Session.GetListByCommand<Person>(command); |
The SQL query needs to fullfil the following constraints for a successful Quino-object mapping:
The primary key (most of the time the “Id”) of the object needs to be selected. Otherwise subsequent calls to “Save” will fail.
All selected columns need to match the “Name” or “SchemaIdentifier” of a property in the class - otherwise the column is not mapped.
Integration with Metadata
...