Access the value of a member expression

Posted by Schotime on Stack Overflow See other posts from Stack Overflow or by Schotime
Published on 2010-04-11T09:58:04Z Indexed on 2010/04/11 10:03 UTC
Read the original article Hit count: 325

If i have a product.

var p = new Product { Price = 30 };

and i have the following linq query.

var q = repo.Products().Where(x=>x.Price == p.Price).ToList()

In an IQueryable provider, I get a MemberExpression back for the p.Price which contains a Constant Expression, however I can't seem to get the value "30" back from it.

Cheers.

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ