Can SqlFunctions work with Dynamic Linq?

dynamic-linq entity-framework

Question

Is it possible to get SqlFunctions to work with Dynamic Linq? I noticed this post from the SO site which seems to suggest that it is possible, however, every time I run this query below in a .NET project (not .NET Core):

query.Where("SqlFunctions.StringConvert((double?)Property).Contains(\"x\")");

It spits back a message that:

No property or field 'SqlFunctions' exists in type 'Entity'

1
0
5/23/2017 12:00:50 PM

Popular Answer

Worked for me. Check you have created your own custom DLinq with added SqlFunctions type to predefinedTypes as per the post.

Personally I'm adding SqlFunctions dynamically to my DLinq. See https://stackoverflow.com/a/18313782/525788 for guidance.

0
9/1/2017 1:58:11 AM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow