Is DbContext the same as DataContext?

Viewed 38161

I'm following a tutorial by Scott Gu that refers to a class named DbContext. I can't find it on any namespace on framework 4 and it seems to me it was renamed from CT4 DbContext to .net4 System.Data.Linq.DataContext. Is my assumption correct?

3 Answers

DbContext

  • one of EntityFramework's classes.
  • represents a Session between your program & a Database.
  • allows your program to send & retrieve data to/from a Database.

DataContext

  • a class you create in your program that inherits from DbContext.
  • use DataContext to retrieve or update data locally in your program.
  • then push changes (using methods from the inherited DbContext) to the actual Database to update it.
Related