Esempio n. 1
0
        public async Task<IActionResult> Edit(CategoryEditModel model)
        {
            var request = new UpdateCatRequest
            {
                RouteName = model.RouteName,
                Note = model.Note,
                DisplayName = model.DisplayName
            };

            await _catService.UpdateAsync(model.Id, request);
            return Ok(model);
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(CategoryEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var request = new UpdateCatRequest
            {
                RouteName   = model.RouteName,
                Note        = model.Note,
                DisplayName = model.DisplayName
            };

            await _catService.UpdateAsync(model.Id, request);

            return(Ok(model));
        }