Main Components of EF - ablealias/MVC GitHub Wiki

Entities

  • Simple .NET classes designed to model the domain.
  • Mapped to the relational data
  • Relate to other entities in the model.

DbSet

  • Represents a collection of all entities of a given type in a context. For example, DbSet<Customer> customers {get; set;}
  • Provides the core of the CRUD methods of an entity.
  • Changes only staged.

DbContext / Custom context class

  • Represents a combination of the unit of work and repository pattern implementations
  • The center of the EF universe
  • The InternalContext provides the majority of the functionality.
  • The Custome Context classes derived from DbContext
  • OnModelCreating event enables additional model configuration.

DBChangeTracker

  • Track all attached entities in a context.
  • Track all changes made to attached entities.
  • Work with DbContext to persist changes.
⚠️ **GitHub.com Fallback** ⚠️