mattwar wrote:
C# and VB already have an equivalent operator to the SQL CASE operator. C# has the ternary/conditional operator which is the 'x ? y : z' operator. VB has the IIF operator, 'IIF(x,y,z)'
Yes, I am aware of that, but what If you want to select from the same source based on cases.
select new { x = Case customerID ==1: assign, Case ProductValue == 20: assign, etc...}
so I can give X values based on the date in the source.
Now you have to do this, get a new anonnymous type, and then query the query again. I want to do this stuff in 1 query rather than multiple queries.
var q1
var q2 that queries q1.
i want only q1 and to be able to select different results based on the data that is there in the data source.
One way to do this is to allow us to use multiple where selects, so
from ..
where..
select ..
where ..
select ..
just like we can do multiple froms, we want multiple selects, or some other way to select based on some multiples of conditions. and then the appropriate where..select, would get triggered based on the data matching.
Just suggestion. Perhaps MS has other syntactically better ways of doing this.