Use Contains in an integer C# field with lambda or LINQ

Asked

Viewed 161 times

3

I have the following expression:

 query = query.Where(x => x.MeuCampoInteiro.ToString().Contains(filter));

But an exception is occurring:

 System.NotSupportedException: 'The expression [10008].MeuCampoInteiro.ToString() is not supported.'

Is there any way to do the ToString() or Contains() in an entire field in the expression lambda?

2 answers

4


  • Sqlfunctions does not appear to me. I have to import something?

  • Yes, I edited with the documentation.

-2

query. Where(x => x.campoInteiro.Tostring(). Contains(campoPesquisa))

Browser other questions tagged

You are not signed in. Login or sign up in order to post.