Beispiel #1
0
        public async Task <ActionResult <MenuItemDto> > CreateMenuItem([FromBody] MenuItemDto menuItemDto)
        {
            if (menuItemDto == null)
            {
                return(BadRequest("Menu Item data must be set!"));
            }
            try
            {
                MenuItemDto created = await _service.CreateMenuItemAsync(menuItemDto);

                return(Ok(created));
            }
            catch (Exception e)
            {
                return(Conflict(e.Message));
            }
        }