其中包含throw的值不能为null [英] Where contains throw Value can't be null

查看:88
本文介绍了其中包含throw的值不能为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被困住了,不知道为什么会发生这个问题.

I'm stuck and don't know why this issue occurs.

通常我们会这样:

var q = await OrmDb.SelectAsync<OrmProductSerial>(p => p.SerialNumber.Contains(reqSearch) );

在这种情况下,我需要这样做,但是会引发错误. ormlite不支持吗? (linq可以做到)

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) );

谢谢.

推荐答案

基于,对于ormlite,您需要改用Sql.In,如下所示:

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)));

这篇关于其中包含throw的值不能为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆