I am trying to convert the following line of SQL to LINQ code :
AND IsNull(Deleted,0) = 0
I have tried by doing this :
&& Deleted != null ? Deleted : false
And this :
&& (bool)Deleted != null ? (bool)Deleted : false
The first attempt gave me an error as Deleted is a nullable type, and the second attempt does not return the same dataset as the original SQL. Can anybody tell me what I am doing wrong?
You can use
&& Deleted.GetValueOrDefault(false) == false