Ejemplo n.º 1
0
        private static void AddTestData(CardCostContext context)
        {
            var cardCost1 = new CardCostEntity
            {
                Country = "GR",
                Cost    = 10
            };

            context.CardCosts.Add(cardCost1);

            var cardCost2 = new CardCostEntity
            {
                Country = "US",
                Cost    = 15
            };

            context.CardCosts.Add(cardCost2);

            context.SaveChanges();
        }
Ejemplo n.º 2
0
        protected void ResetDb(CardCostContext context)
        {
            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            var cardCost1 = new CardCostEntity
            {
                Country = "GR",
                Cost    = 10
            };

            context.CardCosts.Add(cardCost1);

            var cardCost2 = new CardCostEntity
            {
                Country = "US",
                Cost    = 15
            };

            context.CardCosts.Add(cardCost2);

            context.SaveChanges();
        }