Esempio 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);
 }
        private static void InsertCreditCards(BillsPaymentSystemContext context)
        {
            var creditCards = CreditCardInitializer.GetCreditCards();

            foreach (var cd in creditCards)
            {
                if (IsValid(cd))
                {
                    context.CreditCards.Add(cd);
                }
            }

            context.SaveChanges();
        }