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 :)
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 :) )
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:
- Create new MVC Project, I use the default internet project.
- Right click on Models folder, Create new Entity Model (choose empty model)
- Drag an Entity onto the designer, name it User.
- Right click on designer and choose Generate Database
- 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.