public void GetRoomAmenityID() { RoomAmentities amenity = new RoomAmentities(); amenity.RoomID = 5; Assert.Equal(5, amenity.RoomID); }
public void SetAmenityID() { RoomAmentities amenity = new RoomAmentities(); amenity.AmentitiesID = 5; amenity.AmentitiesID = 15; Assert.Equal(15, amenity.AmentitiesID); }
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)); }