예제 #1
0
 public ActionResult Delete(int id)
 {
     try
     {
         _testsRepository.DeleteTest(id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
예제 #2
0
        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));
        }