Пример #1
0
        public void GetRoomAmenityID()
        {
            RoomAmentities amenity = new RoomAmentities();

            amenity.RoomID = 5;
            Assert.Equal(5, amenity.RoomID);
        }
Пример #2
0
        public void SetAmenityID()
        {
            RoomAmentities amenity = new RoomAmentities();

            amenity.AmentitiesID = 5;
            amenity.AmentitiesID = 15;
            Assert.Equal(15, amenity.AmentitiesID);
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("AmentitiesID,RoomID")] RoomAmentities roomAmentities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roomAmentities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AmentitiesID"] = new SelectList(_context.Amentities, "ID", "Name", roomAmentities.AmentitiesID);
            ViewData["RoomID"]       = new SelectList(_context.Room, "ID", "Name", roomAmentities.RoomID);
            return(View(roomAmentities));
        }