Summary
This chapter has introduced the use of Dapper and Entity Framework to provide an abstraction layer between minimal API endpoints and relational databases.
We opened with an introduction to ORMs, defining their role in simplifying database interactions in minimal APIs, before providing an overview of the various features available for interaction with data sources.
We then stepped through the configuration of Dapper, adding the relevant libraries and providing a dedicated DapperService that could be used on minimal API endpoints with dependency injection. Once we had configured Dapper, we created the SQL queries in DapperService and linked the endpoints to the service to provide an end-to-end link between API and database via Dapper.
Having established CRUD operations on the database with Dapper, we contrasted this by configuring Entity Framework, and then performed the equivalent setup of a service for completing CRUD operations.
Finally, the original DapperService...