Quantcast
Viewing all articles
Browse latest Browse all 7

SQL Query in LINQ

Hi Syed,

I meant about your local variable (isPaid)

If IsPaid is "not NULL" then the t.IsPaid == null cannot be true...

Could you please try this one below?

return dc.TicketInfos.Where(t =>
((locationId != null&& t.LocationId == locationId) || t.LocationId == null) &&
((issuerId != null&& t.IssuerId == issuerId) || t.IssuerId == null) &&
(isPaid == null || t.IsPaid == isPaid)).ToList();



Regards, Peter

//If a post answers your question, please click "Mark As Answer".
//Also if a post seems to be helpful, please click "Mark as Helpful" on that post.

Viewing all articles
Browse latest Browse all 7

Trending Articles