public async Task <IActionResult> Edit(int id, [Bind("Id,Title,PhotoFile,ImageMimeType,Description,CreatedDate,UserName")] Photo photo) { if (id != photo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(photo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhotoExists(photo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(photo)); }