---
title: "What are the main components of the Entity Framework Core and how are they used for database access?"  
description: "What are the main components of the Entity Framework Core and how are they used for database access?"  
author: "Utpal Vishwas"  
published: 2023-06-25  
updated: 2023-06-28  
canonical: https://www.mindstick.com/forum/158852/what-are-the-main-components-of-the-entity-framework-core-and-how-are-they-used-for-database-access  
category: ".net core"  
tags: ["asp.net", "asp.net core", ".net core"]  
reading_time: 2 minutes  

---

# What are the main components of the Entity Framework Core and how are they used for database access?

What are the main [components](https://www.mindstick.com/blog/74096/understanding-the-role-of-some-integral-ac-components) of the [Entity Framework](https://www.mindstick.com/articles/1566/crud-operations-using-entity-framework-code-first-approach) Core and how are they used for [database access](https://www.mindstick.com/blog/766/database-access-in-asp-dot-net)?

## Replies

### Reply by Aryan Kumar

The main components of the [Entity](https://www.mindstick.com/forum/160562/database-connectivity-using-entity-framework-database-first-approach) [Framework](https://www.mindstick.com/forum/34615/software-framework-vs-library) Core are:

- **Model:** The model is a collection of classes that represent the data in your [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax). These classes are called entity classes.
- **Context:** The context is an object that provides [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) to the database. It is used to create, read, update, and delete data in the database.
- **Repository:** The repository is an object that provides an abstraction layer for accessing the database. It makes it easier to test your code and to change the underlying database without affecting your application code.
- **DbContext:** The DbContext is the central class in Entity Framework Core. It provides access to the database and manages the state of the entities in your application.
- **Database provider:** The database provider is a library that implements the database-specific functionality of Entity Framework Core. There are providers for a variety of databases, including SQL Server, MySQL, and Oracle.

These components are used for database access in the following way:

1. The model is used to define the data that you want to store in the database.
2. The context is used to interact with the database. It provides methods for creating, reading, updating, and deleting data in the database.
3. The repository is an optional component that can be used to abstract the database access from your application code.
4. The DbContext is the central class in Entity Framework Core. It provides access to the database and manages the state of the entities in your application.
5. The database provider is a library that implements the database-specific functionality of Entity Framework Core. It provides the low-level functionality that Entity Framework Core uses to interact with the database.

Overall, Entity Framework Core is a powerful tool that can be used to simplify database access in .NET Core applications. It provides a number of features that make it easy to work with databases, such as object-relational mapping, code first development, and migrations.


---

Original Source: https://www.mindstick.com/forum/158852/what-are-the-main-components-of-the-entity-framework-core-and-how-are-they-used-for-database-access

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
