Created
June 3, 2017 04:55
-
-
Save manijshrestha/7f2b70f48b8d3609bcfc371586883e35 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
@Module class AppModule(private val context: Context) { | |
@Provides fun providesAppContext() = context | |
@Provides fun providesAppDatabase(context: Context): AppDatabase = | |
Room.databaseBuilder(context, AppDatabase::class.java, "my-todo-db").allowMainThreadQueries().build() | |
@Provides fun providesToDoDao(database: AppDatabase) = database.taskDao() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment