Created
July 10, 2019 10:08
-
-
Save egek92/3efeb567065b2b0053982277d9f8e62b 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 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