IntroductionIn the previous article we learned about the code first approach of the Entity Framework. A Simple Step to Entity Framework: Code First Approach.Now we are discussing the database first approach.This approach uses the development scenario of our database being already developed and we have an existing database and we need to go directly to the coding part. So we can directly create the EDMX for the existing database and we have the option to update the data model when the database schema is changed.A quick start Create an application.Add a new item to the project.Add an ADO.NET Entity Data Model.Select the option Generate from Database and click on the Next button.Click on the New Connection button.Enter the credentials of the database server and select the database name in this wizard.Our connection details will show in the next wizard. Click on the Next button.In this wizard we have the option to select the tables, views, Stored Procedure and functions. Click on the Finish button.Now our EDMX s created.Right-click on the diagram; we can see many options for managing the EDMX.Here one of the options is Update Model from Database, it is for updating the model when we have changes in the database schema.Conclusion In this article we learned the basic details of the Database First Approach of the Entity Framework.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: