0

Starting to play around with EF4 and I notice there are several different ways to query the DB.

Currently I created an .EDMX with my tables/objects created.

In code when I use the Where method, it wants me to pass in a string for the 1st param, ESQL I'm guessing. What I want to use is lambda expressions. All the tutorials show this, but isn't how I'm setup for some reason.

new Entities().Users.Where();
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
ammang
  • 1

2 Answers2

0

Ah, you must include the namespace System.Linq to get the extension methods.

ammang
  • 1
0

Assuming your user entity has a property called LastName, you would write something like this to get all users with the

Entities().Users.Where(u => u.LastName == "Hansen");
thd
  • 2,023
  • 7
  • 31
  • 45