Generated MVC Controllers


Use scaffolding to generate two controllers, BooksController.cs and AuthorsController.cs, described in Slide 5.11:


where the connection string specified in the file points to the database server that we want to connect:
   {
     "Logging": {
       "LogLevel": {
         "Default": "Information",
         "Microsoft.AspNetCore": "Warning"
       }
     },
     "AllowedHosts": "*",
     "ConnectionStrings": {
       "BookStore3Context":
       "Server=localhost\\XQLEXPRESS03;
         Database=BookStore3Context;
         User ID=wenchen;
         Password=database;
         Encrypt=False;
         Trusted_Connection=True;
         MultipleActiveResultSets=true"
     }
   }
The database BookStore3Context is automatically generated as follows:





      “Alcohol: Because no great story ever started    
      with someone eating a salad.”    
      — Dylan Moran