public async Task <ActionResult> Create(TestsCreateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } try { await TestsDao.Create(this, model); } catch (Exception e) { ModelState.AddModelError("", e); return(View(model)); } return(RedirectToAction("Details", new { test = model.TestId })); }
public async Task <IHttpActionResult> Create(TestsCreateViewModel model) { return(JsonWithPermissions(await TestsDao.Create(this, model))); }