public async Task <ActionResult> Create(LabsCreateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } try { await LabsDao.Create(this, model); } catch (Exception e) { ModelState.AddModelError("", e.ToString()); return(View(model)); } return(RedirectToAction("Index")); }
public async Task <IHttpActionResult> Create(LabsCreateViewModel model) { return(JsonWithPermissions(await LabsDao.Create(this, model), true, true, User.IsAdmin())); }