cloudroam
2025-02-14 2fce91b8c0faf1290d8a35ee022dab3cdbc28a54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.example.firstapp.database.repository
 
import androidx.annotation.WorkerThread
import com.example.firstapp.database.dao.CodeDao
import com.example.firstapp.database.entity.Code
 
 
class CodeRepository(private val codeDao: CodeDao) {
 
    @WorkerThread
    fun insert(code: Code): Long = codeDao.insert(code)
 
    @WorkerThread
    fun delete(id: Long) = codeDao.delete(id)
 
    fun getAll() = codeDao.getAllCodes()
 
    fun getAllDesc() = codeDao.getAllCodesDesc()
 
 
}