Exemplo n.º 1
0
 public static void Seed(BillsPaymentSystemContext context)
 {
     InsertValues(UsersInitializer.GetUsers(), context);
     InsertValues(CreditCardInitializer.GetCreditCards(), context);
     InsertValues(BankAccountInitializer.GetBankAccounts(), context);
     InsertValues(PaymentMethodInitializer.GetPaymentMethods(), context);
 }
Exemplo n.º 2
0
        private static void InsertCreditCards(BillsPaymentSystemContext context)
        {
            var creditCards = CreditCardInitializer.GetCreditCards();

            foreach (var creditCard in creditCards)
            {
                if (IsValid(creditCard))
                {
                    context.CreditCards.Add(creditCard);
                }
            }
            context.SaveChanges();
        }
        private static void InsertCreditCards(BillsPaymentSystemContext context)
        {
            var creditCards = CreditCardInitializer.GetCreditCards();

            for (int i = 0; i < creditCards.Length; i++)
            {
                if (IsValid(creditCards[i]))
                {
                    context.CreditCards.Add(creditCards[i]);
                }
            }

            context.SaveChanges();
        }