The next blog post in this series will be to create the basic Model View Controller (MVC) application. A really, really basic one that is literally just the scaffolding.
If you remember, I talked about what I thought the web app pages would be – Location summary and a detail page. So, let’s go with that. The steps are:
- Add Location Controller – Here, you can either add an empty controller or work from another as a base. I usually use the latter since it saves on time. I made a copy of the HomeController.cs, updated the name, kept the index method/error methods and added one for the details view.
- Add an index and detail view
- Update the default start location
Running this sample is just clicking on the basic links to the views for navigation:
I also removed a lot of the generated code that comes with the MVC project. Sometimes I may hold on to some of it, but in this case, I deleted almost everything so I can re-add only what is needed.
The next step will be to add some data to the views with basic Create Read Update Delete (CRUD) functionality. We will use model binding and validation when we do.