Question

The introductory videos for ASP.NET MVC 3 imply that the desired workflow is for me to declare classes that define my model (code-first design).

This strikes me as weird, since Visual Studio has a nice Entity Diagram designer which can generate such classes with navigation properties, etc.

Is it possible to use that Entity Diagram designer to design the model (model-first design), and have ASP.NET MVC 3 understand the generated classes as its model?

Please provide precise steps if possible :) Thanks :)

Was it helpful?

Solution

Apparently it is not possible.

(Anyone wishing to prove me wrong and show how it can be done, please be my guest, but please provide steps :) )

OTHER TIPS

Yes, this is called Model First design. Most of the video's you see have used the Code First approach. There are benefits to both.

This video should help you out.

http://msdn.microsoft.com/en-us/data/ff628199

UPDATE:

Here are the steps I use:

  1. Create new MVC Project, I use the default internet project.
  2. Right click on Models folder, Create new Entity Model (choose empty model)
  3. Drag an Entity onto the designer, name it User.
  4. Right click on designer and choose Generate Database
  5. Use context and entity in project.

It's not difficult, and it works just fine. And it works the same way Model First works anywhere else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top