Use case – exposing WWTravelClub packages
In this section, we will implement an ASP.NET REST service that lists all the packages that are available for a given vacation's start and end dates. For didactic purposes, we will not structure the application according to the best practices described in Chapter 12, Understanding the Different Domains in Software Solutions; instead, we will simply generate the results with a LINQ query that will be directly placed in the controller action method. A well-structured ASP.NET Core application will be presented in Chapter 15, Presenting ASP.NET Core MVC, which is dedicated to the MVC framework.
Let's make a copy of the WWTravelClubDB
solution folder and rename the new folder WWTravelClubREST
. The WWTravelClubDB project was built step by step in the various sections of Chapter 8, Interacting with Data in C# – Entity Framework Core. Let's open the new solution and add a new ASP.NET Core API project to it named WWTravelClubREST...