Пример #1
0
        public async Task <IActionResult> Edit(LanguageDto language)
        {
            if (ModelState.IsValid)
            {
                var isUpdated = await _languageBusiness.UpdateLanguage(language);

                if (isUpdated)
                {
                    return(RedirectToAction("Index"));
                }
            }
            return(View(language));
        }
        public async Task <IActionResult> UpdateLanguage(LanguageDto language)
        {
            if (ModelState.IsValid)
            {
                var isUpdated = await _languageBusiness.UpdateLanguage(language);

                if (isUpdated)
                {
                    var result = await _languageBusiness.GetAllLanguages();

                    return(Ok(result));
                }

                return(NoContent());
            }
            return(BadRequest(ModelState));
        }