Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADO.NET Entity Data Model doesn't update Entities

I'm using MySQL .NET Connector in my ASP.NET MVC project. The connection works fine.

However, after creating a ADO.NET Data Model from my MySQL database (with "Update Model from Database") for the first time, each time I change the database in any way (add/remove tables/properties) and choose "Update Model from Database" again, the .edmx file (designer) updates, but the Entities don't.

How can I update everything? I tried to delete the table from the designer and going through "Update Model from Database" again, it adds the tables to the designer, but the Entities never change.

Is there any way to do this properly?

Walkthrough through the problem:

  • Add table users to designer

  • Add column phone to database table users and refresh Server Explorer, making sure the column is there.

  • Refresh the Data Model, by going to "Update Model from Database" and choosing users table in Refresh tab.

  • The column phone is added to the designer. Everything seems be working fine.

  • Going to the code, the property phone is not in the Entity class.

like image 556
Gaui Avatar asked Apr 27 '26 17:04

Gaui


1 Answers

@Pawel answered this question, but I want to add an accepted answer.

This is a known bug in Visual Studio 2012:

http://entityframework.codeplex.com/workitem/453

This can be fixed with Visual Studio 2012 Update:

http://www.microsoft.com/en-us/download/details.aspx?id=38188

like image 103
Gaui Avatar answered Apr 30 '26 08:04

Gaui



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!