My linq query to summarize something like -
string CustomerID;// can be "ALL" or any value
var itemlist = ( from itmhstry in context.ItemHistories
join itm in context.Items on itmhstry.ItemID equals itm.ItemID into itm_join
where itmhstry.CustomerID == CustomerID
.......................)
and query goes on to select values needed
here how to select all values (like select * >> without filter) when CustomerID
value is ALL/NULL.? How to frame the where clause for this purpose?
I can rewrite same query with if else to have two different queries to handle this issue but is there any simpler way to do?