public IActionResult AddDictManage(LayerDictManageViewModel model) { if (ModelState.IsValid) { _service.AddTableToDictionaries(model.SchemaName, model.TableName); return(RedirectToAction(nameof(DictListManage))); } var mapper = new MapperConfiguration(cfg => cfg.CreateMap <DictionaryDTO, Dict>()).CreateMapper(); model.DictList = mapper.Map <IEnumerable <DictionaryDTO>, List <Dict> >(_service.GetListOfDictionaries()) .OrderBy(x => x.Schema_name) .ThenBy(x => x.Table_name) .ToList(); return(View("DictListManage", model)); }