Beispiel #1
0
        public void SeedLanguages(WestLanguagesContext context)
        {
            var languages = new[]
            {
                new Language("english")
            };

            context.Languages.AddRange(languages);
            context.SaveChanges();
        }
Beispiel #2
0
        public void SeedEverything(WestLanguagesContext context)
        {
            context.Database.EnsureCreated();

            if (context.Languages.Any())
            {
                return;
            }

            SeedLanguages(context);
        }
Beispiel #3
0
        public static void Initialize(WestLanguagesContext context)
        {
            var initializer = new WestLanguagesInitializer();

            initializer.SeedEverything(context);
        }