Completing the admin sales website
The administrator website isn't getting as much attention as the customer website as we don't need it to drive the case study. I'm going to use the Visual Studio scaffold view and controllers for each entity in our data model to save time, using the following procedure for each entity:
Add a reference to our
Model
project as we did for the customer website.Right-click on the
Controllers
folder and go to Add | Controller.Select MVC 5 Controller with views, using Entity Framework from the options and click on Add:
Enter Controller name and select the related entity from the Model class list:
For the first one, I'm going to click on New data context.... I'm not going to modify the
TenantDbContext
class as it's unrelated to our sales data model (I changed the name from the default toAdminWebsite.Models.SalesContext
).Next, click on Add, and Visual Studio will build a controller for you with a full set of views for performing basic CRUD operations.
Do the same for...