c# - Dynamic Linq Querystring not working with mixed operators along with contains -


i have used dynamic linq in application , unfortunately it's not working. here sample code.

list<string> contains = new list<string>() { "poland", "ecuador" }; list<object> array = new list<object>(); array.add("austria"); array.add("eritrea"); array.add(contains);  //this works var data0 = contact.getcontactslist().asqueryable().where("@0.contains(outerit.country)", array);  //this not work var data = contact.getcontactslist().asqueryable().where("country.equals(@0) or it.country.equals(@1) or @3.contains(outerit.country)", array.toarray()); 

i have list of contacts related countries. can see have used mixed operators i.e equals , contains. if contains used separately works correct. tried new thing here, using both equals , contains operators same query string. have attached image describing output or data0 , error while processing data

enter image description here

thank you.

i made silly mistake there. code working fine gave wrong index there. index 3 should replaced 2. :p enter image description here

the result attached.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -