Last active
November 29, 2018 10:55
-
-
Save shkschneider/d0eecde25b37ca28ba24493a3be4f547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object DataManager { | |
@WorkerThread | |
fun dummy(context: Context) { | |
with(MyDatabase.get(context)) { | |
users().insert(User(login = "user.name")) | |
projects().insert(Project(name = "project.name")) | |
notifications().insert(Notification(msg = "created")) | |
} | |
} | |
@WorkerThread | |
fun getUsers(context: Context): List<User> = | |
MyDatabase.get(context).users().getAll() | |
@WorkerThread | |
fun getProjects(context: Context): List<Project> = | |
MyDatabase.get(context).projects().getAll() | |
@WorkerThread | |
fun getNotifications(context: Context): List<Notification> = | |
MyDatabase.get(context).notifications().getAll() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment