Reputation: 4115
How is the best way to get all rows in a table with LINQ?
Upfront i have generated a *.dbml file and created a dbContext.
Upvotes: 2
Views: 2304
Reputation: 18237
Could be
FooDB fooBD = new FooDB();
var foo = fooBD.EntityFoo.ToList();
Upvotes: 3
Reputation: 245429
Just reference the generated enumerable collection in the context class:
var allRecords = context.SomeTable;
Upvotes: 5