DbSet<T>
A property on a DbContext representing one table's entities, which you query with LINQ and add to or remove from.
In more detail
Each DbSet<T> usually corresponds to one database table. db.Products.Where(p => p.Id == id) builds an IQueryable<T> that EF Core runs as SQL.
Related terms
- DbContext — The EF Core class that represents a session with the database: it tracks entities, translates queries and saves changes as one unit of work.
- IQueryable<T> — The .NET interface for a query that a provider such as EF Core translates and runs elsewhere, typically as SQL in a database.
- entity — A thing in an application's domain with its own identity, such as a user, account or product, usually stored in a database.
Taught in
- Entity Framework Core: Code First and Migrations — Modern .NET Core, C# & Enterprise Microservices
- The Repository Pattern — Modern .NET Core, C# & Enterprise Microservices