コード例 #1
0
        /// <summary>
        /// The drop and create database.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        private static void DropAndCreateDatabase(FirebrickContext context)
        {
            DbContext replacedContext = ReplaceSqlCeConnection(context);

            if (replacedContext.Database.Exists())
            {
                replacedContext.Database.Delete();
            }

            context.Database.Create();
        }
コード例 #2
0
 /// <summary>
 /// The seed database.
 /// </summary>
 /// <param name="context">
 /// The context.
 /// </param>
 private static void SeedDatabase(FirebrickContext context)
 {
     var seeder = context as ISeedDatabase;
     if (seeder != null)
     {
         seeder.Seed();
     }
 }