Does EdmFunction work in EF4.3 code-first (no edmx model)
-
15-11-2019 - |
Question
ref: How to create like '234%4' or %2324%335% in EntityFramework
Does the solution using [EdmFunction] work for esql + EF4.3 code-first (where there is no .edmx file) by simply implementing the function? then would it be available in esql, ie: "it.UserName.Like('_user%')" ?
Solution
No. EdmFunction
attribute and its functionality is currently dependent on EDMX mapping file.
OTHER TIPS
Then, as now, you can use .StartsWith
or .Contains
which map to LIKE:
it.UserName.StartsWith("_user")
will translate to
UserName LIKE '_user%'
(and secretly apply your case insensitive collations and such, causing Contains to deviate from an accurate mapping to the local functionality.)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow