Beispiel #1
0
        public async Task <JsonResult> AddDishExtras(IFormCollection form)
        {
            try
            {
                var id             = JsonConvert.DeserializeObject <int>(form["dishId"]);
                var dishExtraTypes = JsonConvert.DeserializeObject <List <DishExtraType> >(form["dishExtraTypes"]);
                await _service.AddDishExtraTypes(id, dishExtraTypes);

                return(Json("Success"));
            }
            catch (Exception ex)
            {
                return(Json("Failed"));
            }
        }