Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq - Boolean - where statement

Tags:

c#

linq

boolean

I have the below code which I am struggling with.

var q = from hed in cxt.SOPOrderReturns.ToExpandable()
        join cus in cxt.SLCustomerAccounts 
              on hed.CustomerID equals cus.SLCustomerAccountID
        join ad in cxt.SOPDocDelAddresses 
              on hed.SOPOrderReturnID equals ad.SOPOrderReturnID
        where hed.AnalysisCode1 == "SO"
        select new
        {
            hed.SOPOrderReturnID,
            hed.DocumentNo,
            hed.DocumentDate,
            cus.CustomerAccountNumber,
            Route = hed.AnalysisCode2,
            Drop = hed.AnalysisCode5,
            hed.ReadyForInvoicePrint,
        };

q = q.RemoveExpandable();

return q;

The column hed.ReadyForInvoicePrint is Boolean and I want to add a where statement which also shows if the column is FALSE.

Thanks

Jamie

like image 949
Jamie hampson Avatar asked Jan 19 '26 09:01

Jamie hampson


1 Answers

You can filter on false value of this column by adding && !hed.ReadyForInvoicePrint to your where statement.

like image 175
Lemx Avatar answered Jan 20 '26 23:01

Lemx