parsing expression trees with booleans

Posted by Schotime on Stack Overflow See other posts from Stack Overflow or by Schotime
Published on 2010-05-04T06:57:24Z Indexed on 2010/05/04 6:58 UTC
Read the original article Hit count: 344

I am trying to parse an expression tree for a linq provider and running into a little snag with booleans.

I can parse this no problems.

var p = products.Where(x=>x.IsAvailable == true).ToList();

however when its written like this?

var p = products.Where(x=>x.IsAvailable).ToList();

i only get a MemberAccess to look at and i can't see how i deduce that it is true or false (!x.IsAvailable). Any help would be great.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about lambda-expressions