简体   繁体   中英

Linq Dynamic Query Issue - Operator 'OR' incompatible with operand types 'Boolean' and 'String'

I am currently trying to define a dynamic query in Linq but I am receiving the following error: 在此处输入图片说明

My Query is the following:

valuesList = valuesList.Where("(position=1 OR value LIKE '%3%')")

What am I doing wrong?

Try this-
You cannot pass string inside a linq statement

 valuesList = valuesList.Where(x=>x.position == 1 || x.value.Contains(3))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM