implementation of CRUD operations on some entities present on the "Northwind" DB of MS with authentication scheme JWTBearer. In order to access the swagger endpoints, you need to generate the JWT separately with the JWTAuthAPI project. The reason for this choice is for training purposes as (theoretically) an Access Token is generated by an authentication server. In my case, the JWTAuthApi project uses the MS Identity provider. the CRUD Northwind project is structured in a 3-layer architecture where
- the base layer is the DBLayer and takes care (through the repository pattern) to access and query the db with EF Core. Each CRUD operation is performed asynchronously inside an anonymous method which is handled inside an exception handling function. Each data retrieved is then passed to the services of each entity present and queried by the DBLayer
- the intermediate layer is the ServiceLayer and takes care of calling the CRUD operations of the various repositories by mapping each entity into DTO (and vice versa). The various DTOs are then passed on to their respective endpoints in the controllers
- the upper layer is the viewLayer and contains the program.cs for the various configurations, including the DIs of each entity with the respective interface and the management and connection of the authentication services and finally the controllers for each entity to take advantage of the CRUDs.
- The ConfigurationLayer library allows access through the use of the IOption<> interface to read the parameters of secret, Audience and Issure in order to ensure the authentication of the JWT with the JWTAuthApi project