I'm a little confused about the "best practice" controller using the question.
My typical code view
public ActionResult Edit(int reportId,FormCollection formCollection) { try { var report = _dbContext.EmployeeReports.Find(reportId); if (TryUpdateModel(report)) { _employeeReportService.Update(report); return RedirectToAction("List"); } return View("Edit", report); } catch (Exception) {
Well, is it better to use "TryUpdateModel" or just "UpdateModel" or just call Model.IsValid and is there a good idea to catch the exception in the controller?
thanks
asp.net-mvc asp.net-mvc-3 controller
Mennion
source share