C#
C#

help

Root Question Message

BlueJayBird
BlueJayBird8/11/2022
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?
Nox
Nox8/11/2022
There's a lot of nuance but the short answer is yes, that's a high level view of it
Nox
Nox8/11/2022
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
Message Not Public

Sign In and Join Server To See

8/11/2022
Angius
Angius8/11/2022
Generally speaking:
- DbContext abstracts the database
- DbSet abstracts the table
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy