//GET: ReviewOnDoctor/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(new StatusCodeResult(400)); } ReviewOnDoctor review = _context.ReviewOnDoctor.Find(id); if (review == null) { return(NotFound()); } ViewData["physicianId"] = new SelectList(_context.physician, "physicianId", "physicianName"); return(View(review)); }
//public async Task<IActionResult> Edit(int id,[Bind("ReviewId", "DoctorName", "Message", "Reply")] ReviewOnDoctor review) //{ // if(id != review.ReviewId) // { // return NotFound(); // } // if(ModelState.IsValid) // { // try // { // _context.Update(review); // await _context.SaveChangesAsync(); // } // catch (DbUpdateConcurrencyException) // { // if (!ReviewOnDoctorExists(review.ReviewId)) // { // return NotFound(); // } // else // { // throw; // } // } // return RedirectToAction(nameof(List)); // } // return View(review); //} //GET: ReviewOnDoctor/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(new StatusCodeResult(400)); } ReviewOnDoctor review = _context.ReviewOnDoctor.Find(id); if (review == null) { return(NotFound()); } //ViewData["physicianId"] = await _context.ReviewOnDoctor.Include(a => a.Physician).Skip(start).Take(perpage).ToListAsync(); ViewData["physicianId"] = new SelectList(_context.physician, "physicianId", "physicianName"); return(View(review)); }