Esempio n. 1
0
        public async Task <IActionResult> UpdateAsync([FromBody] FoodManage dto)
        {
            try
            {
                await foodService.CreateAsync(dto);

                return(Ok());
            }
            catch (EntityNotFoundException <Food> )
            {
                return(NoContent());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([FromBody] FoodCreate food)
        {
            await _foodService.CreateAsync(food);

            return(new NoContentResult());
        }