The type of the field is defined based on the type of the corresponding column (DbType attribute). If the resulting property type differs from the field type, the conversion is performed after a value is obtained from DbDataReader. One more thing: type can influence the selection of the DB SQL function. For example, Int32 can be mapped to INTERVAL YEAR TO MONTH in Oracle and the sum of two Int32 values in C# will be translated into the sum of two variables of the INTERVAL YEAR TO MONTH type.
LinqConnect supports the following methods and operators:
CLR Construction | SQL analogues |
---|---|
DbType attribute | Corresponding database type |
Nullable<Type> | Column allows NULL |
Operators +–*~^% || && <> == <= >= | Translated into SQL analogues |
"true" and "false" .NET constants | Translated into SQL analogues (can be different for various DBMS) |
The methods of some specific classes (DateTime, String, TimeSpan and Decimal) are translated to corresponding SQL constructions. For example, Compare, Equals, IndexOf methods of String class are translated to the equal SQL functions.