I am trying to check if a given search term can be found in an Id through Linq.
I tried with where(x => x.Id.ToString().Contains(term))
but that doesn't work as it gives an exception that .ToString
is not supported
I also tried to use SqlFunctions.StringConvert((double)x.Id).Contains(term)
, but that doesn't work as well as it gives the exception
'The specified method System.String StringConvert(System.Nullable`1[System.Double]) on the type System.Data.Objects.SqlClient.SqlFunctions cannot be translated to a LINQ to Entities store expression.'
How can I get this query working without loading everything into memory (which is not what I want)
The application is using EF 5.0 and is connected to an oracle DB
SqlFunctions.StringConvert((double?)x.Id) does not work.