I have the following code in Entity Framework:
using(var dbc = new TestDbContext())
{
var data = (from a in dbc.tableList
select new { a = id }).ToList();
}
When I was debugging the code I came across the following piece of code
public class TestDbContext : DbContext
{
public TestDbContext()
{
}
public DbSet<Table> tableList {get;set;}
}
I am wondering like without even creating an instance of DbSet<Table>
like this :
public Dbset<Table> tableList = new Dbset<Table>();
how am I able to query the table for eg:
in
var data = (from a in dbc.tableList
select new { a = id }).ToList();