private static void SeedPaymentMethods(BillsPaymentSystemContext database) { PaymentMethod[] paymentMethods = PaymentMethodGenerator.GeneratePaymentMethods(); for (int i = 0; i < paymentMethods.Length; i++) { if (Validater.IsEntityValid(paymentMethods[i])) { database.PaymentMethods.Add(paymentMethods[i]); } } database.SaveChanges(); }
private static void SeedBankAccounts(BillsPaymentSystemContext database) { BankAccount[] bankAccounts = BankAccountGenerator.GenerateBankAccounts(); for (int i = 0; i < bankAccounts.Length; i++) { if (Validater.IsEntityValid(bankAccounts[i])) { database.BankAccounts.Add(bankAccounts[i]); } } database.SaveChanges(); }
private static void SeedCreditCards(BillsPaymentSystemContext database) { CreditCard[] creditCards = CreditCardGenerator.GenerateCreditCards(); for (int i = 0; i < creditCards.Length; i++) { if (Validater.IsEntityValid(creditCards[i])) { database.CreditCards.Add(creditCards[i]); } } database.SaveChanges(); }
private static void SeedUsers(BillsPaymentSystemContext database) { User[] users = UserGenerator.GenerateUsers(); for (int i = 0; i < users.Length; i++) { if (Validater.IsEntityValid(users[i])) { database.Users.Add(users[i]); } } database.SaveChanges(); }