How to express "is null" sql syntax in linq to sql -
how can express "is null" sql syntax in linq sql?
where(r => (r.level1.equals(l[1] == "" ? null : l[1]))
in above code linq sql converts linq expression following sql not want.
@p1=null
i want linq converted following sql
@p1 null
how can achieve this?
try this
if (l[1] == "") where(r => (r.level1 == null)); else where(r => (r.level1 == l[1]));
if use ternary operator expression evaluator find it's expression returning string, cause of it'll use = operator.
Comments
Post a Comment