예제 #1
0
      public SessionsController(PoolsContext context)
      {
          _context = context;

          if (_context.Sessions.Count() == 0)
          {
              _context.Sessions.Add(new Models.Sessions {
                    ID = 1, From = "08:00", To = "08:30", Name = "Jutarnji"
                });
              _context.Sessions.Add(new Models.Sessions {
                    ID = 2, From = "12:00", To = "13:00", Name = "Popodnevni"
                });
              _context.Sessions.Add(new Models.Sessions {
                    ID = 3, From = "19:30", To = "21:30", Name = "Večernji"
                });
              _context.SaveChanges();
          }
      }
예제 #2
0
      public PoolsController(PoolsContext context, ILogger <PoolsController> logger)
      {
          _context = context;
          _logger  = logger;

          if (_context.Pools.Count() == 0)
          {
              _context.Pools.Add(new Models.Pools {
                    ID = 1, Name = "Olimpijski", Size = "50x25m", Deepth = "2m"
                });
              _context.Pools.Add(new Models.Pools {
                    ID = 2, Name = "Rekreativni", Size = "25x16m", Deepth = "1.20m"
                });
              _context.Pools.Add(new Models.Pools {
                    ID = 3, Name = "Dečiji", Size = "20x12m", Deepth = "20cm"
                });
              _context.SaveChanges();
          }
      }