Ejemplo n.º 1
0
        public static void Initialize(VendingMachineContext context)
        {
            context.Database.EnsureCreated();

            // Look for any existing data.
            if (context.Machines.Any())
            {
                return;   // DB has been seeded
            }

            // Add Machine
            var machine = new Machine
            {
                Wallet   = InitializeWallet(),
                Products = InitializeProducts()
            };

            context.Machines.Add(machine);

            context.SaveChanges();
        }
Ejemplo n.º 2
0
 public MachineRepository(VendingMachineContext dbContext) : base(dbContext)
 {
 }
Ejemplo n.º 3
0
 public Repository(VendingMachineContext dbContext)
 {
     _dbContext = dbContext;
 }