Ejemplo 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 InsertPaymentMethods(BillsPaymentSystemContext context)
        {
            var paymentMethods = PaymentMethodInitializer.GetPaymentMethods();

            foreach (var pm in paymentMethods)
            {
                if (IsValid(pm))
                {
                    context.PaymentMethods.Add(pm);
                }
            }

            context.SaveChanges();
        }