Answered by:
can we use entity framework database when database is not fixed

Question
-
User569149469 posted
Hi,
I want to know whether we can use entity framework with database first aproach even when the data base is not fixed means it will change. we can add new modules like that.
Saturday, December 15, 2018 3:05 PM
Answers
-
User475983607 posted
Can you provide me with an example or article showing that.
The standard EF Core documentation covers migrations quite well. Start by learning the basics.
However, your question has nothing to do with EF core. Your question is related your teams SDLC process and how to sync the DB schema and Entities. The same devops problem exists regardless of the technology.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, December 16, 2018 10:42 PM -
User-271186128 posted
Hi phmaspnet,
I want to know whether we can use entity framework with database first aproach even when the data base is not fixed means it will change. we can add new modules like that.Yes, of course. You can do it.
Since, you are using Entity Framework with DataBase First. When the Database changes, you could open the .edmx file to display the model diagram. Right-click anywhere on the design surface, and select Update Model from Database. Then, in the Update Wizard, you could select related tables and generate the model.
More detail steps, please check these articles:
EF Database First with ASP.NET MVC: Changing the Database
Create And Update An .edmx File Using Entity Framework Data Model In Visual Studio
Best regards,
Dillion- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 17, 2018 5:21 AM
All replies
-
User475983607 posted
I want to know whether we can use entity framework with database first aproach even when the data base is not fixed means it will change. we can add new modules like that.
I don't see why not. It is up to you and your team to come up with a policy for updating the DB schema - handling migrations.
Saturday, December 15, 2018 10:42 PM -
User1120430333 posted
Hi,
I want to know whether we can use entity framework with database first aproach even when the data base is not fixed means it will change. we can add new modules like that.
Yes you can use EF DB first on the virtual model and updating the existing VM with new model, which you would do a Verify to validate any new model added or an existing model is being changed or even a model had been deleted from the VM that you verify the model.
Now onw will assume that you know some MS SQL server DBA skills so that you can deploy database schema to different environments like from development to test and from test to QA and from OA to production. Of course, your application executables with the DB known to EF must match.
Saturday, December 15, 2018 11:26 PM -
User569149469 posted
Hi,
Can you provide me with an example or article showing that.
Sunday, December 16, 2018 10:12 PM -
User475983607 posted
Can you provide me with an example or article showing that.
The standard EF Core documentation covers migrations quite well. Start by learning the basics.
However, your question has nothing to do with EF core. Your question is related your teams SDLC process and how to sync the DB schema and Entities. The same devops problem exists regardless of the technology.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, December 16, 2018 10:42 PM -
User-271186128 posted
Hi phmaspnet,
I want to know whether we can use entity framework with database first aproach even when the data base is not fixed means it will change. we can add new modules like that.Yes, of course. You can do it.
Since, you are using Entity Framework with DataBase First. When the Database changes, you could open the .edmx file to display the model diagram. Right-click anywhere on the design surface, and select Update Model from Database. Then, in the Update Wizard, you could select related tables and generate the model.
More detail steps, please check these articles:
EF Database First with ASP.NET MVC: Changing the Database
Create And Update An .edmx File Using Entity Framework Data Model In Visual Studio
Best regards,
Dillion- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 17, 2018 5:21 AM -
User1120430333 posted
Hi,
Can you provide me with an example or article showing that.
[/quote
What version of EF are you planning on using? I will assume you are talking about any EF version that is non Core EF like EF 6, becuase people do make the distinction if he or she is using EF Core.
Monday, December 17, 2018 6:47 AM