Consider i have the following linq query.I want to specify the condition in where clause as a string as i will make it empty when i wont have any condition.But on doing so i am getting the error : "Cant explitily convert string to bool".I know the reason for the error.I just want to know is there any other alternative to implement the following.
var elements = from element in array
orderby element descending
where element > 2
select element;
string condition="element >"+2;
I want to do the following....
var elements = from element in array
orderby element descending
where condition<------------
select element;
PS:I will handle the situation when there is no condition and the where clause is left with no condition.
Thanks in advance...