Ejemplo n.º 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new SimpleBankContext(serviceProvider.GetRequiredService <DbContextOptions <SimpleBankContext> >()))
            {
                if (context.User.Any())
                {
                    return;
                }

                context.User.AddRange(
                    new User
                {
                    UserID      = "user01",
                    Name        = "Jack Dowson",
                    PhoneNumber = "0891237797"
                },
                    new User
                {
                    UserID      = "user02",
                    Name        = "Charlie Angel",
                    PhoneNumber = "0996857214"
                }
                    );

                context.BankAccount.AddRange(
                    new BankAccount
                {
                    BankAccountID = "NL93INGB9730769656",
                    UserID        = "user01",
                    Balance       = 0.0
                },
                    new BankAccount
                {
                    BankAccountID = "NL59ABNA9313499797",
                    UserID        = "user02",
                    Balance       = 0.0
                }
                    );

                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public DeleteModel(SimpleBank.Data.SimpleBankContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public EditModel(SimpleBank.Data.SimpleBankContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public DetailsModel(SimpleBank.Data.SimpleBankContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public IndexModel(SimpleBank.Data.SimpleBankContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public TransferModel(SimpleBank.Data.SimpleBankContext context)
 {
     _context = context;
 }