JavaCake
JavaCake

Reputation: 4115

How to get all the rows from a table

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

Answers (2)

Jorge
Jorge

Reputation: 18237

Could be

FooDB fooBD = new FooDB();
var foo = fooBD.EntityFoo.ToList();

Upvotes: 3

Justin Niessner
Justin Niessner

Reputation: 245429

Just reference the generated enumerable collection in the context class:

var allRecords = context.SomeTable;

Upvotes: 5

Related Questions