public ActionResult CreateLanguage(CreateLanguageViewModel languageViewModel) { try { if (ModelState.IsValid) { // Get the culture info var cultureInfo = LanguageUtils.GetCulture(languageViewModel.Name); using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { try { LocalizationService.Add(cultureInfo); unitOfWork.Commit(); ShowSuccess("Language Created"); } catch (Exception ex) { unitOfWork.Rollback(); LoggingService.Error(ex); throw; } } } else { var errors = (from key in ModelState.Keys select ModelState[key] into state where state.Errors.Any() select state.Errors.First().ErrorMessage).ToList(); ShowErrors(errors); } } catch (Exception ex) { ShowError(ex.Message); } // Default ie error return(RedirectToAction("Index")); }