PacktContacts will be the demo project to be hosted and deployed on our various environments. This project is built using some of the features learned in this book, such as attribute routing, custom middleware, link generation, and route constraints.
Create an ASP.NET Core Web API project with the name PacktContacts, create a web API controller class ContactsController in the controller folder, and copy the following code:
namespace PacktContacts.Controllers { [Route("api/[controller]")] public class ContactsController : Controller { static List<Contact> ContactList = new List<Contact>(); // GET: api/Contacts [HttpGet] public IActionResult Get() { return Ok(ContactList); } // GET api/Contacts/5 ...