Total Page Preview:   000000000200

What is DBContext class in Asp.Net Core MVC in English and Hindi

DBContext class in Asp.Net Core MVC in English

DbContext is a class in Entity Framework, which is an Object-Relational Mapping (ORM) framework for .NET applications. The DbContext class serves as a bridge between your application and the database, providing an abstraction layer to interact with the database using high-level, object-oriented approaches instead of direct SQL queries. It enables you to define and work with your application's data model using C# classes, and it handles the translation of these classes and their relationships into corresponding database tables and queries. In essence, DbContext manages the connection, tracking, and querying of data between your application and the underlying database.

In this example, you would have a Customer class defined in the EF_Core_MVC.Models namespace, which would represent the structure of your Customer entity. The DbContextOptions<DBCtx> parameter passed to the constructor will contain the configuration details for your database connection. The DbSet<Customer> property allows you to interact with the Customer entity in your database.
This DBCtx class serves as the central point for interacting with your database using Entity Framework Core. It encapsulates the logic for querying and manipulating data, while also providing a high-level abstraction for working with your database entities.
 
 
DBContext class in Asp.Net Core MVC in Hindi
DbContext class Entity Framework mein ek important class hai jo database se data ko manipulate karne aur query karne ke liye use hoti hai. Ye class application ke aur database ke beech ek bridge ka kaam karti hai, jisse aap database se data ko object-oriented tareeko se interact kar sakte hain. DbContext class aapke model classes aur database ke beech mapping ko manage karti hai aur aapko SQL queries likhne ki zaroorat nahi hoti. Iske saath hi, ye class database connection, data tracking, aur data retrieval ko handle karti hai.
 
Iska simple tareeka yeh hai ki aap apne application mein DbContext class ka use karke apne model classes ko database se link karke CRUD (Create, Read, Update, Delete) operations perform kar sakte hain, bina seedhe SQL queries likhe.
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: