Exemplo 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());
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([FromBody] FoodCreate food)
        {
            await _foodService.CreateAsync(food);

            return(new NoContentResult());
        }