J. Doe
J. Doe

Reputation: 167

How to update my database generated by "code first from database"?

I just added two more columns to my database via SQL Server Management Studio. Now I'd like to use this in my WPF/C# application. How do I update the *.cs files in my project? I generated These files by adding a new item --> ADO.NET Entity Data Model --> Code first from database (using entity Framework 6). For some reason I dont have a "model" or something like that.

Do I have to delete the files and add a new item?

Thank you

Upvotes: 1

Views: 129

Answers (2)

Na Me
Na Me

Reputation: 389

As @ErikEJ said, you must delete the files and regenerate them. When you choose code first from database EF6 assumes that you wont change the model anymore (correct me if I'm wrong)

Upvotes: 2

ErikEJ
ErikEJ

Reputation: 41769

Yes, remove the files and regenerate them

Upvotes: 2

Related Questions