0
Fala Pessoal,
I have a problem that may be not doing correctly, I have a query in a table description field for example
Select description table Where field like 'test%Description'
How do I do this search with Entity framework? because if I use the term o Contains
, he would do +/- as like '%teste descricao%'
, but that’s not what I want.
Context.Item.Where(c=> c.descricao.Contains(termo)).toList();
Thanks for the Help
Alex
The problem is if I have a larger term for example TV Led 40 , I think I’ll have to use the Entity framework sqlQuery....
– Alex Becker
I didn’t understand the question of the greater term...rs
– Rovann Linhalis
Sorry, a term greater than 2 words 3 four etc...each term would have to have a joker '%'
– Alex Becker
there’s a problem with what you’re wanting, because
like 'teste%descricao'
is different fromlike 'teste%' or like '%descricao'
What’s your real need? @Alexbecker– Rovann Linhalis
Ola Rovann, I have a search field that you should search by the terms reported on the base in this way : e.g. " test Description of anything" like 'test%Description%of anything' wanted a way to do it by the Entity framework but it seems a bit complex, the best way to use it I think is to do the search with sqlQuery.... I don’t see any other way....
– Alex Becker
that’s exactly what:
'teste%descricao%de%qualquer%coisa'
that I put in the comment above. that doesn’t make much sense, that’s exactly what you want ?– Rovann Linhalis