when I added entityfarme work model in mvc Application ..so ultimately it added respected model classes for each table in database .and it added commented line in each class like that

// <auto-generated>

// This code was generated from a template.

//

// Manual changes to this file may cause unexpected behavior in your application.

// Manual changes to this file will be overwritten if the code is regenerated.

// </auto-generated>

Now the problem is if I added another table in database ..and wanted to create respective class in same application ..should I drop .edmx file and recreate EF model so that it cover added table in project ..??

Edited 1 Year Ago by pritaeas: Moved to C#

You just hit update model from database as far as I remember - no need to delete.

I am doing code first now though which is much better but I'm sure that's right.

Edited 1 Year Ago by DaveAmour

code first is best when working with test environment ..

but i want to use any other technique..do not want to drop or create db again.and again

You are using database first - we are not telling you to change that. We are just saying that code first is better.

To answer your original question (which I have done already) - just right click on your edmx and click update model from database. Ok?

Edited 1 Year Ago by DaveAmour

Based on years of experience and many discusions with other experienced developers both face to face and online and through working in many different companies as a contractor and seeing them both in use.

Database first has it's place of course in certain scenarios but for the most part code first is far superior.

Edited 1 Year Ago by DaveAmour

Database first has it's place of course in certain scenarios but for the most part code first is far superior.

Is this serious suggestion?

Is this serious suggestion?

Am sure it is. I do think it works when starting something from scratch and you are free to do your own database.

Edited 1 Year Ago by pritaeas

This article has been dead for over six months. Start a new discussion instead.