public async Task <ActionResult> Create(SamplesCreateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } Sample sample; try { sample = await SamplesDao.Create(this, model); } catch (Exception e) { ModelState.AddModelError("", e); return(View(model)); } return(RedirectToAction("Details", new { sample = sample.SampleId })); }
public async Task <IHttpActionResult> Create(SamplesCreateViewModel model) { return(JsonWithPermissions(await SamplesDao.Create(this, model))); }