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 InsertPaymentMethod(BillsPaymentSystemContext context) { var paymentMethods = PaymentMethodInitializer.GetPaymentMethods(); for (int i = 0; i < paymentMethods.Length; i++) { if (IsValid(paymentMethods[i])) { context.PaymentMethods.Add(paymentMethods[i]); } } context.SaveChanges(); }
private static void InsertPaymentMethods(BillsPaymentSystemContext context) { var paymentMethods = PaymentMethodInitializer.GetPaymentMethods(); foreach (var pm in paymentMethods) { if (IsValid(pm)) { context.PaymentMethods.Add(pm); } } context.SaveChanges(); }
private static void InsertPaymentMethods(BillsPaymentSystemContext context) { PaymentMethod[] payments = PaymentMethodInitializer.GetPaymentMethods(); for (int index = 0; index < payments.Length; index++) { if (IsValid(payments[index])) { context.PaymentMethods.Add(payments[index]); } } context.SaveChanges(); }