mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
プロバイダ作成
This commit is contained in:
1 file changed
+9
-2
@@ -1,8 +1,13 @@
|
|||||||
package one.nem.lacerta.source.database;
|
package one.nem.lacerta.source.database;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.room.Room;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import dagger.hilt.InstallIn;
|
import dagger.hilt.InstallIn;
|
||||||
|
import dagger.hilt.android.qualifiers.ApplicationContext;
|
||||||
import dagger.hilt.components.SingletonComponent;
|
import dagger.hilt.components.SingletonComponent;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@@ -10,7 +15,9 @@ import dagger.hilt.components.SingletonComponent;
|
|||||||
public class LacertaDatabaseModule {
|
public class LacertaDatabaseModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
public LacertaDatabase provideLacertaDatabase() {
|
public LacertaDatabase provideLacertaDatabase(@ApplicationContext Context context) {
|
||||||
return null;
|
return Room.databaseBuilder(context,
|
||||||
|
LacertaDatabase.class,
|
||||||
|
"lacerta.db").build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user