In the Controllers folder, add a new class named CustomersController.cs.
In the CustomersController class, add the following code, and note the following:
- The controller class registers a route that starts with api and includes the name of the controller, that is, api/customers.
- The constructor uses dependency injection to get the registered repository for customers.
- There are five methods to perform CRUD operations on customers—two GET methods (all customers or one customer), POST (create), PUT (update), and DELETE.
- GetCustomers can have a string parameter ...