---
title: "Database connectivity using Entity Framework database-first approach?"  
description: "Database connectivity using Entity Framework database-first approach?"  
author: "Revati S Misra"  
published: 2024-01-15  
updated: 2024-07-15  
canonical: https://www.mindstick.com/forum/160562/database-connectivity-using-entity-framework-database-first-approach  
category: ".net core"  
tags: ["asp.net", "asp.net core", ".net core"]  
reading_time: 2 minutes  

---

# Database connectivity using Entity Framework database-first approach?

[Database connectivity](https://www.mindstick.com/blog/462/database-connectivity-in-c-sharp) using [Entity Framework](https://www.mindstick.com/articles/1566/crud-operations-using-entity-framework-code-first-approach) database-first [approach](https://www.mindstick.com/interview/985/what-are-the-approaches-that-you-will-follow-for-making-a-program-very-efficient)?

## Replies

### Reply by Manish Sharma

To establish [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) [connectivity](https://www.mindstick.com/startup/29/airalo-the-global-esim-service-powering-travel-in-over-200-countries) using the [Entity](https://www.mindstick.com/forum/160563/what-is-db-first-approach-in-entity-framework-core) [Framework](https://www.mindstick.com/forum/34615/software-framework-vs-library) **database-first approach**, follow these steps:

1. **Create a new project** in Visual Studio and choose the appropriate project type (e.g., Console Application, Web Application, etc.).
2. Right-click on the project in Solution Explorer and select **"Add" > "New Item" > "Data" > "ADO.NET Entity Data Model".**
3. Choose **"EF Designer from the database" and click "Next".**
4. Select **"Generate from database" and click "Next".**
5. Configure the database connection by clicking **"New Connection"** and entering the necessary connection details (server name, authentication method, database name, etc.).
6. Test the connection and click **"OK"** to save the connection settings.
7. Select the database objects (tables, views, stored procedures, etc.) that you want to include in the Entity Framework model and click **"Finish"** to generate the model.
8. Once the model is generated, you can use it to interact with the database in your application code. For example, you can create instances of the generated entity classes, query the database **using LINQ, and perform CRUD operations.**
9. You can also customize the generated entity classes and mappings as needed by modifying the generated code or using attributes and fluent API configurations.

By following these steps, you can establish database connectivity using the Entity Framework database-first approach and start using the generated entity model to interact with the database in your application.


---

Original Source: https://www.mindstick.com/forum/160562/database-connectivity-using-entity-framework-database-first-approach

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
