public async Task <IActionResult> Edit(int id, [Bind("BedID,Address,Description,PricePerHour")] Bed bed, TimePeriod time) { if (id != bed.BedID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bed); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BedExists(bed.BedID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bed)); }