public ActionResult Create(Widget newWidget) { try { if (ModelState.IsValid) { _case.CreateWidget(newWidget.Name, newWidget.Price); return(RedirectToAction("Index")); } else { return(View(newWidget)); } } catch { return(View(newWidget)); } }
public ActionResult Create(Widget newWidget) { try { if (ModelState.IsValid) { _case.CreateWidget(newWidget.Name, newWidget.Price, newWidget.User.Id); return(RedirectToAction("Index")); } else { return(View(newWidget)); } } catch (Exception e) { Log.Error(e.Message); return(View(newWidget)); } }