public App(string dbPath) { InitializeComponent(); DbPath = dbPath; using var context = SqliteContextFactory.CreateDbContext(); context.Database.Migrate(); var container = new Container(); container.Register <IRequestService, RequestService>(); container.Register <IPermissionService, PermissionService>(); container.Register <INavigationService, NavigationService>(Lifestyle.Singleton); container.Register <IDataService, DataService>(); container.Register <IDialogService, DialogService>(); container.Register <ICameraService, CameraService>(); container.Register <IFileService, FileService>(); Container = container; var initialPage = new NavigationPage(new MainPage()); var navigationService = container.GetInstance <INavigationService>(); navigationService.Init(initialPage); MainPage = initialPage; }
NetworkTrackerContext CreateNetworkTrackerContext() { if (_options != null) { if (_options.ProviderOptions != null) { if (_options.ProviderOptions.Provider == DatabaseProviderType.Sqlite) { var factory = new SqliteContextFactory(); return(String.IsNullOrWhiteSpace(_options.ProviderOptions.ConnectionString) ? factory.CreateSqliteContext() : factory.CreateSqliteContext(_options.ProviderOptions.ConnectionString)); } } } else { var factory = new SqliteContextFactory(); return(factory.CreateSqliteContext()); } }
public UserRepositoryTest() { AgendaVoluntariaDatabaseMock = SqliteContextFactory.GetAgendaVoluntariaContext(); notifierMock = new Notifier(); RepositoryUnderTest = new UserRepository(AgendaVoluntariaDatabaseMock, notifierMock); }
public DataService() { _context = SqliteContextFactory.CreateDbContext(); }