问题
I'm stuck and don't know why this issue occurs.
Normally we do like this:
var q = await OrmDb.SelectAsync<OrmProductSerial>(p => p.SerialNumber.Contains(reqSearch) );
In this case I need do like this, but it throws an error. Doesn't ormlite support this ? ( linq can do it )
var q = await OrmDb.SelectAsync<OrmProductSerial>(p => reqSearch.Contains(p.SerialNumber) );
Thanks.
回答1:
Based on this, for ormlite
, you need to use Sql.In
instead, something like this:
OrmDb.SelectAsync<OrmProductSerial>(p => p.Where(c => Sql.In(c.SerialNumber,reqSearch)));
来源:https://stackoverflow.com/questions/60108806/where-contains-throw-value-cant-be-null