This solution is obsolete. Refer to theHow to: Implement a Custom Criteria Language Operator article for a recommended solution.
Database engines provide specific functions that aren't implemented in XPO. XPO still allows you to call such a function by creating a custom ConnectionProvider class and overriding its FormatFunction method. This example shows how to use the T-SQL DATEPART function in your XPO projects. Please pay attention to the Northwind.Order.OrderMonth property in the Northwind module and to the CustomCommand.MyMsSqlConnectionProvider.FormatFunction method in MyMsSqlConnectionProvider.
This sample requires MS SQL Server or SQL Express with a Northwind demo database.
See Also: How to implement the ICustomFunctionOperatorFormattable interface