コード例 #1
0
        public static void Initialize(string fileOrConnection)
        {
            using (VoiceMemosContext dbContext = new VoiceMemosContext(fileOrConnection))
            {
                if (dbContext.DatabaseExists() == false)
                {
                    // Create the local database.
                    dbContext.CreateDatabase();

                    // Seed data.
                    Seed(dbContext);

                    // Save changes to database
                    dbContext.SubmitChanges();

                    // Set the database version.
                    SchemaMigrator.SetSchemaVersion(dbContext);
                }
                else
                {
                    SchemaMigrator.ApplyMigrations(dbContext);
                }
            }
        }
コード例 #2
0
 private static void Seed(VoiceMemosContext context)
 {
     // TODO: Add data seed logic if needed.
 }