Exemple #1
0
 /// <summary>
 /// Creates and initializes the database with test records the first time the application starts  at first time.
 /// </summary>
 /// <param name="libraryContext">The library context.</param>
 private void CreateAndSeedDatabase(LibraryContext libraryContext)
 {
     if (!(libraryContext.GetService <IDatabaseCreator>() as RelationalDatabaseCreator).Exists())
     {
         libraryContext.Database.EnsureCreated();
         SeedDatabase(libraryContext);
     }
 }