예제 #1
0
        public IActionResult Post(string values)
        {
            var model = new NavigationMenu();

            model.PopulateModel(values);

            if (!TryValidateModel(model))
            {
                return(BadRequest(ModelState.GetFullErrorMessage()));
            }

            if (model.ParentMenuId == 0)
            {
                model.ParentMenuId = null;
            }

            _navigateMenuService.AddNavigationMenuAsync(model);

            return(Json(new { model.Id }));
        }