Share Pastebin
Guest
Public paste!

Ivan

By: a guest | Jan 19th, 2010 | Syntax: C# | Size: 0.52 KB | Hits: 105 | Expires: Never
Copy text to clipboard
  1.   1:  ParameterExpression pc = Expression.Parameter(typeof(Customer), "c");
  2.    2:  
  3.    3:  IQueryable<Customer> q3 =
  4.    4:      dc.Customers.Where<Customer>
  5.    5:      (
  6.    6:          Expression.Lambda<Func<Customer, bool>>
  7.    7:          (
  8.    8:              Expression.Equal(
  9.    9:              Expression.Property(pc, typeof(Customer).GetProperty("City")),
  10.   10:              Expression.Constant("London", typeof(string))
  11.   11:          ),
  12.   12:          new ParameterExpression[] { pc }
  13.   13:          )
  14.   14:      );