如何处理 NHibernate QueryOver 中的空值?

问题描述

我有以下查询,当列表 AccountNumbersdescriptions 具有值并从数据库返回匹配值时,它可以正常工作。但是当列表有一个空值时它不起作用。

如何扩展此查询以支持空值?

    var testQuery = session.QueryOver<Account>()
                            .Where(account => !account.IsDeleted && account.Owner.Id == owner.Id)
                            .Where(Restrictions.In(Projections.SqlFunction(
                            "lower",NHibernateUtil.String,Projections.Property<Account>(x => x.AccountNumber)),accountNumbers.ToList()))
                            .Where(Restrictions.In(Projections.SqlFunction(
                            "lower",Projections.Property<Account>(x => x.Description)),descriptions.ToList()));

        var lst = testQuery.List();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)