Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var options = new DbContextOptionsBuilder <DatabaseContext>()
                          .UseSqlServer(@"Data Source=.;Initial Catalog=UOWConsumerDb;User ID=UOWConsumerDbUser;Password=UOWConsumerDbUser")
                          .Options;

            using (var context = new DatabaseContext(options))
            {
                DatabaseSeed.SeedSql(context);

                Console.WriteLine($"Seed added {context.Categories.ToList().Count} categories");
                Console.WriteLine($"Seed added {context.Suppliers.ToList().Count} suppliers");
                Console.WriteLine($"Seed added {context.Products.ToList().Count} products");
            }

            Console.ReadLine();
        }