Exemplo n.º 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));
            }
        }
Exemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            bool result = service.Delete(id);

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

            return(NoContent());
        }
Exemplo n.º 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());
        }
Exemplo n.º 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());
 }
Exemplo n.º 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());
        }
Exemplo n.º 8
0
        public async Task <IActionResult> Delete(int id)
        {
            await _service.Delete(id);

            return(NoContent());
        }
Exemplo n.º 9
0
 public void Delete(int id)
 {
     _departureService.Delete(id);
 }
Exemplo n.º 10
0
 public void Delete()
 {
     service.Delete();
 }