Пример #1
0
        public ParkingSpotController(ParkingSpotContext context)
        {
            _context = context;

            if (_context.ParkingSpots.Count() == 0)
            {
                _context.ParkingSpots.Add(new ParkingSpot {
                    Name = "Item1"
                });
                _context.SaveChanges();
            }
        }
        public static void Initialize(ParkingSpotContext context)
        {
            context.Database.EnsureCreated();

            if (context.ParkingSpots.Count() == 0)
            {
                context.ParkingSpots.Add(new ParkingSpot {
                    Lat = 10, Long = 10, capacity = 200, usage = 0
                });
                context.ParkingSpots.Add(new ParkingSpot {
                    Lat = 5, Long = 20, capacity = 100, usage = 0
                });
                context.SaveChanges();
            }
        }
 public ParkingSpotsController(ParkingSpotContext context)
 {
     _context = context;
 }