0

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 by pritaeas: Moved to C#

4
Contributors
11
Replies
43
Views
2 Years
Discussion Span
Last Post by DaveAmour
Featured Replies
0

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 by DaveAmour

0

code first is best when working with test environment ..

0

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

0

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 by DaveAmour

1

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 by DaveAmour

0

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?

0

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 by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.