Creating a SQLite data store
Until this point, the My Media Collection project has only worked with data stored inside in-memory collections. This means that every time the application is closed, all the user’s data is lost. It has also meant calling a method to populate all the lists with hardcoded seed data each time the application is launched.
In the previous chapter, we took the first step in creating a maintainable data service for the application. By creating a data service class that implements IDataService
, no changes will be required in the ViewModel
classes when we start loading data from a database. This section will focus on creating a new SqliteDataService
class so that we can use SQLite for data access. The starting code for this chapter can be found on GitHub at https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition/tree/master/Chapter06/Start.
What is SQLite?
SQLite (found at https://sqlite.org/) is a SQL-based database that is frequently used...