Exemple #1
0
 public IActionResult Delete(int id)
 {
     try
     {
         service.Delete(id);
         return(NoContent());
     }
     catch (Exception ex)
     {
         return(NotFound(ex));
     }
 }
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await service.Delete(id);

                return(NoContent());
            }
            catch (Exception ex)
            {
                return(NotFound(ex));
            }
        }
Exemple #3
0
        public IActionResult Delete(int id)
        {
            bool result = service.Delete(id);

            if (!result)
            {
                return(NotFound());
            }

            return(NoContent());
        }
Exemple #4
0
        public async Task <ActionResult> Delete(int id)
        {
            var success = await _departureService.Delete(id);

            if (success)
            {
                return(Ok());
            }

            return(BadRequest());
        }
        public async Task <IActionResult> Delete(int id)
        {
            bool result = await service.Delete(id);

            if (!result)
            {
                return(NotFound());
            }

            return(NoContent());
        }
Exemple #6
0
 public async Task <IActionResult> Delete(int id)
 {
     try
     {
         await service.Delete(id);
     }
     catch (ValidationException e)
     {
         return(BadRequest(new { Exception = e.Message }));
     }
     return(NoContent());
 }
Exemple #7
0
        public IActionResult Delete(Guid id)
        {
            try
            {
                departureService.Delete(id);
            }
            catch (Exception ex)
            {
                return(BadRequest(new { Type = ex.GetType().Name, ex.Message }));
            }

            return(NoContent());
        }
Exemple #8
0
        public async Task <IActionResult> Delete(int id)
        {
            await _service.Delete(id);

            return(NoContent());
        }
Exemple #9
0
 public void Delete(int id)
 {
     _departureService.Delete(id);
 }
 public void Delete()
 {
     service.Delete();
 }