Handle server functions in multi-database support
Each RDBMS supports additional functions which are exposed in EF. Problem is that the same functions are exposed with different names. For example:
if (isSqlServer)
query = query.Where(p => SqlFunctions.StringConvert(p.BankId));
else // is Oracle
query = query.Where(p => OracleFunctions.ToChar(p.BankId));
However this makes code less readable and a bit harder to maintain, due to it being redundant, not to say that it doesn't attend database-ignorance.
This would be better:
query = query.Where(p => EntityFunctions.ToString(p.BankId));
As I think this is the most common scenario, it could be just p.BankId.ToString().