public async Task <IHttpActionResult> GetTest(Guid id) { Test test = await testsRepository.GetTest(id); if (test == null) { return(NotFound()); } return(Ok(test)); }
public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TestW test = _rep.GetTest(id.Value); if (test == null) { return(HttpNotFound()); } ViewBag.TestCategoryId = new SelectList(_rep.GetCategories(), "Id", "Name", test.TestCategoryId); ViewBag.AcredetationLevelId = new SelectList(_rep.GetAcredetationLevels(), "Id", "Level", test.AcredetationLevelId); ViewBag.TypeId = new SelectList(_rep.GetTestTypes(), "Id", "Type", test.TypeId); return(View(test)); }
public Test GetTest(Guid id) { return(_testsRepo.GetTest(id)); }