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; }
public DataService() { _context = SqliteContextFactory.CreateDbContext(); }