示例#1
0
        public IActionResult CreateDrawer(DrawerRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _drawerRangeRepository.CreateDrawer(request);
            return(Ok());
        }
示例#2
0
        public ActionResult <DrawerResponse> UpdateDrawer(int id, DrawerRequest request)
        {
            var countryToUpdate = _drawerRangeRepository.FindDrawerResourceById(id);

            if (countryToUpdate == null)
            {
                return(NotFound());
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var result = _drawerRangeRepository.UpdateDrawer(id, request);

            return(Ok(result));
        }