public void Initialize <T>() { using (var conn = _iconn.GetConnection()) { conn.CreateTable <T>(); } }
public IEnumerable <Product> GetFavorites() { var db = _sqlite.GetConnection(DBNAME); db.CreateTable <Product>(); return(db.Table <Product>()); }
public Place GetPlace(int id) { using (var connection = SQLite.GetConnection()) { var list = connection.Query <SQLitePlace>("SELECT * FROM SQLitePlace WHERE Id = ?", id); if (list == null || list.Count == 0) { throw new NotFoundPlaceException(string.Format("Not found place with id: {0} in local database.", id)); } return(FromSQLitePlaceToPlace(list.FirstOrDefault())); } }
private void PrepareDatabase() { ISQLite db = null; using (var scope = Container.BeginLifetimeScope()) db = scope.Resolve <ISQLite>(); if (db == null) { return; } db.GetConnection().CreateTable <ClienteModel>(); db.GetConnection().DeleteAll <ClienteModel>(); }
public StatsService(ISQLite dbservices, IEventServices eventServices, ITimeServices timeServices) { this.dbservices = dbservices; Connection = dbservices.GetConnection(); EventServices = eventServices; TimeServices = timeServices; }
public SQLiteIncidentService() { localdb = DependencyService.Get<ISQLite> (); using(var conn = localdb.GetConnection ()) { conn.CreateTable<Incident> (); } }
public UserService(ISlackRestClient restClient, ISQLite sqlite) { _restClient = restClient; _database = sqlite.GetConnection(); _database.CreateTable <User>(); _database.CreateTable <UserProfile>(); }
public AddRunnerPageViewModel(ISQLite sQLite, IRunnerServices RunnerServices, INavigationService navigationService) { SqlServices = sQLite; NavigationService = navigationService; this.RunnerServices = RunnerServices; Connection = SqlServices.GetConnection(); SaveRunnerCommand = new DelegateCommand(SaveRunnerMethod); }
public UserService(ISlackRestClient restClient, ISQLite sqlite) { _restClient = restClient; _database = sqlite.GetConnection(); _database.CreateTable<User>(); _database.CreateTable<UserProfile>(); }
public SQLiteRatingRepository(ISQLite sqlLite) { _sqlLite = sqlLite; //TESTING DropTable(); //TESTING CreateTable(); DataSet = _sqlLite.GetConnection().Table<Rating>(); }
public SQLiteCommentRepository(ISQLite sqlLite) { _sqlLite = sqlLite; //TESTING DropTable(); //TESTING CreateTable(); DataSet = _sqlLite.GetConnection().Table<Comment>(); }
public SQLiteSavedUserRepository(ISQLite sqlLite) { _sqlLite = sqlLite; //TESTING // _sqlLite.DeleteDatabase(); //TESTING CreateTable(); DataSet = _sqlLite.GetConnection().Table<SavedUser>(); }
public DatabaseService(ISQLite sqlite) { _sqlite = sqlite; var connection = _sqlite.GetConnection(); UpdateDatabase(connection); _connection = _sqlite.GetAsyncConnection(); }
public RunnerPageViewModel(ISQLite dbservices, IRunnerServices runnerServices, INavigationService navigationService) { NavigationService = navigationService; NavigateToAddRunnerPageCommand = new DelegateCommand(NavigateToAddRunnerPage); NavigateToStatsCommand = new DelegateCommand <Runner>(NavigateToStatsMethod); SqlServices = dbservices; RunnerServices = runnerServices; Connection = SqlServices.GetConnection(); IsBusy = true; }
public UnitOfWork(ISQLite sqlite) { DB = sqlite.GetConnection(); _AlunoRepository = new GenericRepository <Aluno, long>(DB, DBLocker); lock (DBLocker) { DB.CreateTable <Aluno>(); } }
public BaseRepository(ISQLite sqlite, IEventAggregator eventAggregator) { _connection = sqlite.GetConnection(); _asyncConnection = sqlite.GetAsyncConnection(); _eventAggregator = eventAggregator; CreateTableIfNonExistent(); _eventAggregator.GetEvent <LogoutEvent>().Subscribe(async() => await RemoveAllAsync()); }
public DbContext(ISQLite connection) { _connection = connection.GetConnection(); Token = new DbSet <AuthToken>(_connection); Client = new DbSet <Client>(_connection); UsageItem = new DbSet <UsageItem>(_connection); Location = new DbSet <Location>(_connection); User = new DbSet <User>(_connection); UserTask = new DbSet <UserTask>(_connection); UserTaskTime = new DbSet <UserTaskTime>(_connection); }
public MainPageViewModel(INavigationService navigationService, ISQLite dbservices, IEventServices eventServices, IPdfServices pdfServices) : base(navigationService) { Title = "Main Menu"; NavigateToRunnerPageCommand = new DelegateCommand(NavigateToRunnerPage); DeleteAllCommand = new DelegateCommand(DeleteAllMethod); NavigateToEventsPageCommand = new DelegateCommand(NavigateToEventsPage); this.navigationService = navigationService; this.dbservices = dbservices; Connection = dbservices.GetConnection(); dbservices.CreateTables(Connection); this.EventServices = eventServices; GetNotRanEvents(); }
public void OpenConnection() { _connection = _sqlite.GetConnection(); }
public SQLiteConnection GetConnection() { return(_sqlite.GetConnection()); }
//private static object _locker = new object(); public AppDatabase(ISQLite sqlLite) { SqlLiteAsyncConnection = sqlLite.GetConnection(); }
// start implement public SQLiteNhanVienStore(ISQLite db) { _connection = db.GetConnection(); _connection.CreateTableAsync <NhanVien>(); }
public TransactionScope(ISQLite SQLite) { _dataBase = SQLite.GetConnection(); _savePointId = BeginTransaction(); }
public ClienteService(ISQLite sqlite) { _conn = sqlite.GetConnection(); }
public IList <Property> GetAll() { var con = Database.GetConnection(); return(con.Query <Property> ("SELECT * FROM Properties", new object[] { })); }
protected BaseSQLite() { iSQLite = Locator.Current.GetService <ISQLite>(); db = iSQLite.GetConnection(); }
public IList <ListEntry> GetByDate(DateTime date) { var con = Database.GetConnection(); return(con.Query <ListEntry> ("SELECT * FROM ListEntries WHERE Date = ?", new object[] { date.ToString("yyyy-MM-dd 00:00:00.000") })); }
public RunnerServices(ISQLite dbservices, ITimeServices timeServices) { this.dbservices = dbservices; this.Connection = dbservices.GetConnection(); this.TimeServices = timeServices; }
public ActivityRepository(ISQLite sqlite) { _db = sqlite.GetConnection(); _db.CreateTable <Activity>(); _db.CreateTable <ActivityPosition>(); }
public ContactDatabase(ISQLite sqLite) { _database = sqLite.GetConnection(); }
public LocalRepository(ISQLite sql) { _sql = sql; _connection = _sql.GetConnection(); }
private SQLiteConnection GetConnection() { return(conMngr.GetConnection()); }
public UserRepository() { _sqlite = Resolver.Resolve<ISQLite>(); _connection = _sqlite.GetConnection(); _connection.CreateTable<User>(); }
public SqLiteService(ISQLite sqlLite) : base(sqlLite.GetConnection()) { }
public TimeServices(ISQLite dbservices) { this.dbservices = dbservices; this.Connection = dbservices.GetConnection(); }