Skip to content

Instantly share code, notes, and snippets.

@egek92
Created July 10, 2019 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egek92/3efeb567065b2b0053982277d9f8e62b to your computer and use it in GitHub Desktop.
Save egek92/3efeb567065b2b0053982277d9f8e62b to your computer and use it in GitHub Desktop.
@Module
class DataBaseModule {
@Provides
@Singleton
fun provideRoom(app: Application): AppDatabase = Room
.databaseBuilder(app, AppDatabase::class.java, BuildConfig.APPLICATION_ID)
.build()
@Provides
@Singleton
fun provideHotelsDao(room: AppDatabase): HotelsDao = room.hotelsDao()
@Provides
@Singleton
fun provideVisitorsDao(room: AppDatabase): VisitorsDao = room.visitorsDao()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment