Esempio n. 1
0
        public async Task <IActionResult> DeleteAsync(Guid id)
        {
            try
            {
                await foodService.DeleteAsync(id);

                return(Ok());
            }
            catch (EntityNotFoundException <Food> )
            {
                return(NoContent());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Esempio n. 2
0
 public Task <IActionResult> DeleteAsync(long id)
 {
     return(_foodService.DeleteAsync(id).ResultAsync());
 }
Esempio n. 3
0
        public async Task <IActionResult> Delete(long id)
        {
            await _foodService.DeleteAsync(id);

            return(new NoContentResult());
        }