比较“串”和“无效”在linq到实体 [英] comparing "string" and "null" in linq to entity

查看:126
本文介绍了比较“串”和“无效”在linq到实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码:

string name;
db.Entities.Where(m=>m.name==(name??m.name))
throw:Should be CHAR, but get NCLOB.

// ----------------

//----------------

  decimal? id;
  db.Entities.Where(m=>m.id==(id??m.id))
  The code is working.  

我的数据库是oracle。

我该怎么做才能使代码工作

my database is oracle.
What should I do to make the code working.?

谢谢。

推荐答案

请注意,在Oracle中为空string为NULL。

Beware that in Oracle an empty string is NULL.

这篇关于比较“串”和“无效”在linq到实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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