public ActionResult Delete(int id) { try { _testsRepository.DeleteTest(id); return(Ok()); } catch (Exception e) { return(BadRequest(e)); } }
public async Task <IHttpActionResult> DeleteTest(Guid id) { Test test = await testsRepository.GetTest(id); if (test == null) { return(NotFound()); } await testsRepository.DeleteTest(id); return(Ok(test)); }