0

VS2013, VB MVC 5

The MVC 5 framework created a database for me from the classes I defined in the Models. I thought it would be appropriate to create an edmx file, but the Entity Data Model Wizard offers 3 options that generate class files which are in conflict with the existing classes & the 4th option just creates an empty Model.

So, is it even possible to create an edmx Model which can then be used to graphically work with my Classes, or is this a wrong question?

As I read through other stack overflow questions I couldn't quite see the answer, which leads me to believe my question may be based on a wrong understanding of how the Entity Data Model is intended to be used. One question seemed to suggest the Migration History created during the Code First methodology is actually an entire separate way of working for which the .edmx model isn't really relevant.

If you can, please help me sort out this issue.

Alan
  • 1,587
  • 3
  • 23
  • 43

1 Answers1

0

The edmx file in effect generates your POCO classes for you based on a table's columns.

It sounds like you're going the code first approach, in which case your model/POCO classes already exist.

I don't believe there's any reason to have an edmx when using code first, unless you wanted a separate context with separate entities.

See here for a breakdown of the different entity framework approaches (db first, model first, code first): Code-first vs Model/Database-first

Community
  • 1
  • 1
Kritner
  • 13,557
  • 10
  • 46
  • 72
  • Thanks for confirming and clearing up my confusion. That was a great link! Thanks for that also. Yes, I was using Code First, but this was my first time. I had gotten used to Model/Database first and didn't realize Code First doesn't really use the diagram I had gotten so used to! – Alan Sep 03 '14 at 20:23