public virtual ISQLiteAsyncConnection CreateConnection(string dbName) { ILocalStorageService storageService = ServiceProvider.GetService <ILocalStorageService>(); IActivatorService activatorService = ServiceProvider.GetService <IActivatorService>(); Func <string, ISQLiteAsyncConnection> factory = activatorService.CreateInstance <Func <string, ISQLiteAsyncConnection> >(); ISQLiteAsyncConnection db = factory(storageService.GetFilePath(dbName, LocalFolderKind.Data)); return(db); }
protected override void OnStart(StartParameter parameter) { base.OnStart(parameter); ISQLiteService service = ServiceProvider.GetService <ISQLiteService>(); ISQLiteAsyncConnection connection = service.OpenDefaultConnection(); if (!connection.Connection.TableExists <Property>()) { connection.CreateTableAsync <Property>(); } if (!connection.Connection.TableExists <RecentSearch>()) { connection.CreateTableAsync <RecentSearch>(); } // Set the root ViewModel to be displayed at startup this.SetRootViewModel <PropertySearchViewModel>(); }
public RequestHistory(ISQLiteAsyncConnection sqlite) { this.sqlite = sqlite; }