Technical requirements
For this chapter, create a new branch off the existing data transfer object (DTO) branch (so that we start with valid data). You will need the following:
- Visual Studio
AutoMapper
FluentValidation
The FluentValidation
library is a powerful tool for creating validators that we will use throughout this chapter. You can install it in various ways, but the easiest is as a NuGet package. You’ll also want the package for ASP.NET, as shown in Figure 5.1:
Figure 5.1 – NuGet installation
You can find the complete documentation for FluentValidation
at https://docs.fluentvalidation.net/en/latest/index.html#. I will provide detailed steps as we go along.
The code files for this chapter can be found in the GitHub repository here: https://github.com/PacktPublishing/Programming-APIs-with-C-Sharp-and-.NET/tree/main/Chapter05