linq动态查询中字段为null的,该如何处理

linq动态查询中字段为null的[codeC#]publicxxfind(int?value){varquery....wherefiledvalueselect...}[

linq动态查询中字段为null的
  [code=C#]
public   xx   find(int?   value)
{
        var   query=....
                            where   filed=value
                            select   ...
}
[/code]

如果filed有null的数据   value为null的时候却查不到。请问该如何处理。

[解决办法]
DBNull.Value
[解决办法]
"int?" 说明你这个字段在数据库内设置了可空类型
在使用时要强制转化一下 where filed!=null && (int)filed==value
[解决办法]
var query=(...from ... select..)
.Where(i=>value.HasValue ? i.filed==value.Value : true);