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
Nox2y 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
Xymanek2y ago
also a single DbSet may represent more than 1 table (although this is definitely more advanced setups territory)
Angius
Angius2y ago
Generally speaking: - DbContext abstracts the database - DbSet abstracts the table
Accord
Accord2y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server
More Posts