Beispiel #1
0
        private static void LoadPizzaMenu(string connectionString)
        {
            var pizzas = new List <PizzaEntity>
            {
                new PizzaEntity("Pepperoni", 10),
                new PizzaEntity("Meat Lovers", 11),
                new PizzaEntity("Canadian", 12),
                new PizzaEntity("Supreme Lovers", 13),
                new PizzaEntity("Veggie Lovers", 14),
                new PizzaEntity("Cheese Lovers", 15),
            };

            var pizzaRepository = new TableStorageRepository <PizzaEntity>(connectionString, PizzaEntity.TableName);

            foreach (var pizza in pizzas)
            {
                pizzaRepository.AddOrUpdateAsync(pizza).GetAwaiter().GetResult();
                Console.WriteLine($"Added pizza: {pizza.Name}");
            }
        }