예제 #1
0
        /// <summary>
        /// Initialize context
        /// </summary>
        /// <param name="context">NPVCalculatorDbContext object</param>
        public static void Initialize(NPVCalculatorDbContext context)
        {
            var initializer = new NPVCalculatorInitializer();

            initializer.SeedEverything(context);

            context.Database.Migrate();
        }
예제 #2
0
        /// <summary>
        /// Method for seeding every table
        /// </summary>
        /// <param name="context">NPVCalculatorDbContext object</param>
        public void SeedEverything(NPVCalculatorDbContext context)
        {
            context.Database.EnsureCreated();

            if (context.Projections.Any())
            {
                return; // Db has been seeded
            }

            //SeedUsers(context);
        }