Exemple #1
0
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            try
            {
                ILocalPath path   = DependencyService.Get <ILocalPath>();
                string     dbPath = path.DatabasePath(_databasePath);
                if (string.IsNullOrEmpty(dbPath))
                {
                    throw new Exception("ILocalPath.DatabasePath: returned null reference");
                }

                optionsBuilder.UseSqlite($"Filename={dbPath}");
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }