© Les Jackson 2020
L. JacksonThe Complete ASP.NET Core 3 API Tutorialhttps://doi.org/10.1007/978-1-4842-6255-9_7

7. Persisting Our Data

Les Jackson1 
(1)
Melbourne, VIC, Australia
 

Chapter Summary

In this chapter we’ll move away from mock data and implement our data access and persistence layers to store and retrieve data in a PostgreSQL database.

When Done, You Will

  • Have configured a PostgreSQL instance (including setting up a new instance in Docker if required)

  • Have created a Database Context (DB Context) class using Entity Framework Core

  • Have used “migrations” to create the necessary schema in our database

  • Have created a new implementation of our repository interface to use our DB Context

  • Have used Dependency Injection to swap out our mock repository ...

Get The Complete ASP.NET Core 3 API Tutorial: Hands-On Building, Testing, and Deploying now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.