示例#1
0
        public App()
        {
            InitializeComponent();

            var databasePath = DependencyService.Get <IFilePath>().GetFilePath("mydb.db");

            try
            {
                using (var db = new myContext(databasePath))
                {
                    db.Database.Migrate();

                    var fido = new Dog
                    {
                        Age  = 7,
                        Name = "Fido",

                        NEWPROPERTYVIAMIGRATE = "worked?"
                    };

                    db.Dogs.Add(fido);
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
            }

            MainPage = new App11.MainPage();
        }
示例#2
0
        public App()
        {
            InitializeComponent();

            MainPage = new App11.MainPage();
        }