示例#1
0
        protected override void OnAppearing()
        {
            string dbPath = DependencyService.Get <IPath>().GetDatabasePath(App.DBFILENAME);

            using (ApllicationContext db = new ApllicationContext(dbPath))
            {
                leaderBoard.ItemsSource = db.DbModels.ToList();
            }
            base.OnAppearing();
        }
示例#2
0
        private void LoadToDB()
        {
            var dbPath = DependencyService.Get <IPath>().GetDatabasePath(App.DBFILENAME);

            using (var db = new ApllicationContext(dbPath))
            {
                DbModel dbModel = new DbModel()
                {
                    Name = "bla", Score = Score
                };
                db.DbModels.Add(dbModel);
                db.SaveChanges();
            }
        }