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 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(); }