public ActionResult Create(ServiceCategoryViewModel viewModel) { try { if (ModelState.IsValid) { var entity = Mapper.Map <ServiceCategoryViewModel, ServiceCategory>(viewModel); _categoryService.Insert(entity); viewModel.Locales.ToList().ForEach(l => { _localizedEntityService.SaveLocalizedValue(entity, e => e.Name, l.Name, l.LanguageId); _localizedEntityService.SaveLocalizedValue(entity, e => e.Content, l.Content, l.LanguageId); }); return(RedirectToAction("Index")); } } catch (Exception e) { ModelState.AddModelError("", e.Message); } return(View(viewModel)); }