What are exactly DbContext and DbSet in EF? [Answered]

I was wondering if getting the DbContext is getting the entire DB and using DbSet is using the single tables. Is this correct?
4 Replies
Nox
Nox3y ago
There's a lot of nuance but the short answer is yes, that's a high level view of it A Context may have as much or as little of the database as needed, and a DbSet may not represent the full table in the case of query filters/etc
Xymanek
Xymanek3y ago
also a single DbSet may represent more than 1 table (although this is definitely more advanced setups territory)
Angius
Angius3y ago
Generally speaking: - DbContext abstracts the database - DbSet abstracts the table
Accord
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server