I currently have this controller function:
public ViewResult Edit(int id)
{
var user = _adminRepository.GetUser(id);
return View(user);
}
This currently gives me an error on my browse page if I try to edit an item with id 100 if there is no user with id 100 in the database.
What is the best practice for this? Send them to the "Create" page or show a friendly error message? Should this redirection function be in the controller function?
source
share