This article can be useful for programmers who want to develop a cross-database applications and use the canonical functions.
Entity Framework Canonical Functions are a set of functions, which are supported by all Entity Framework providers. These canonical functions will be translated to the corresponding data source functionality for the provider.
The tables below contain information about these functions supported by the Devart products. Functions supported by the following DBMS: MySQL, PostgreSQL, Oracle, SQLite, DB2, SQL Server 2005, and SQL Server 2008 are marked with green.
Please note, that the "EF version" column contains a number of Entity Framework version in which this function was defined. Additionally note that Entity Framework Canonical Functions are not supported in Entity Framework Core. This topic is applicable only to previous Entity Framework versions.
Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
Avg | v1 | |||||||
BigCount* | v1 | |||||||
Count | v1 | |||||||
Max | v1 | |||||||
Min | v1 | |||||||
StDev | v1 | |||||||
StDevP | v4 | |||||||
Sum | v1 | |||||||
Var | v4 | |||||||
VarP | v4 |
Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
Abs | v1 | |||||||
Ceiling | v1 | |||||||
Floor | v1 | |||||||
Power | v4 | |||||||
Round(value) | v1 | |||||||
Round(value, digits) | v4 | |||||||
Truncate | v4 |
Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
Concat | v1 | |||||||
Contains | v4 | |||||||
EndsWith | v4 | |||||||
IndexOf | v1 | |||||||
Left | v1 | |||||||
Length | v1 | |||||||
LTrim | v1 | |||||||
Replace | v1 | |||||||
Reverse | v1 | /* | ||||||
Right | v1 | |||||||
RTrim | v1 | |||||||
Substring | v1 | |||||||
StartsWith | v4 | |||||||
ToLower | v1 | |||||||
ToUpper | v1 | |||||||
Trim | v1 |
* The Reverse function is supported with PostgreSQL 9.1 and higher.
You can read more about String Canonical functions in MSDN.Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
AddNanoseconds* | v4 | |||||||
AddMicroseconds | v4 | |||||||
AddMilliseconds | v4 | |||||||
AddSeconds | v4 | |||||||
AddMinutes | v4 | |||||||
AddHours | v4 | |||||||
AddDays | v4 | |||||||
AddMonths | v4 | |||||||
AddYears | v4 | |||||||
CreateDateTime | v4 | |||||||
CreateDateTimeOffset | v4 | |||||||
CreateTime | v4 | |||||||
CurrentDateTime | v1 | |||||||
CurrentDateTimeOffset | v4 | |||||||
CurrentUtcDateTime | v1 | |||||||
Day | v1 | |||||||
DayOfYear | v4 | |||||||
DiffNanoseconds | v4 | |||||||
DiffMilliseconds | v4 | |||||||
DiffMicroseconds | v4 | |||||||
DiffSeconds | v4 | |||||||
DiffMinutes | v4 | |||||||
DiffHours | v4 | |||||||
DiffDays | v4 | |||||||
DiffMonths | v4 | |||||||
DiffYears | v4 | |||||||
GetTotalOffsetMinutes | v1 | |||||||
Hour | v1 | |||||||
Millisecond | v1 | |||||||
Minute | v1 | |||||||
Month | v1 | |||||||
Second | v1 | |||||||
Truncate | v4 | |||||||
Year | v1 |
Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
BitWiseAnd | v1 | |||||||
BitWiseNot | v1 | |||||||
BitWiseOr | v1 | |||||||
BitWiseXor | v1 |
Canonical Function Name | EF version | Oracle | MySQL | PostgreSQL | SQLite | DB2 | MS SQL Server 2005 | MS SQL Server 2008 - 2016 |
---|---|---|---|---|---|---|---|---|
NewGuid | v1 |
Entity Framework Support | Entity Framework Tutorial | Using Database-Specific Functions in Entity Framework