Exemplo n.º 1
0
        public static void SeedDatabase(DataContext context)
        {
            var categories = SampleDataSource.GetCategories();

            context.Categories.AddOrUpdate(categories.ToArray());

            var courses = SampleDataSource.GetCourses();

            context.Courses.AddOrUpdate(courses.ToArray());

            context.SaveChanges();
        }