ModelRepositoryImpl

@Singleton
class ModelRepositoryImpl @Inject constructor(modelDao: ModelDao) : ModelRepository

The class that implements the ModelRepository interface.

Parameters

modelDao

The ModelDao object that is used to access the database.

Constructors

Link copied to clipboard
@Inject
constructor(modelDao: ModelDao)

Creates a singleton instance of the ModelRepositoryImpl class.

Functions

Link copied to clipboard
open suspend override fun deleteModel(model: Model)

Delete the given Model from the database by using modelDao.

Link copied to clipboard
open override fun getAllModelsStream(): Flow<List<Model>>

Get the stream of all Models in the database by using modelDao.

Link copied to clipboard
open override fun getModelStream(uid: Int): Flow<Model?>

Get the stream of Models by uid from the database by using modelDao.

Link copied to clipboard
open suspend override fun insertModel(model: Model)

Insert a Model into the database by using modelDao.

Link copied to clipboard
open suspend override fun updateModel(model: Model)

Update the given Model in the database by using modelDao.