private IEnumerable <Layer> GetDictionaries() { try { var mapper = new MapperConfiguration(cfg => cfg.CreateMap <LayerDTO, Layer>()).CreateMapper(); return(mapper.Map <IEnumerable <LayerDTO>, List <Layer> >(_service.GetDicts())); } catch (Exception e) { ModelState.AddModelError("", e.Message); return(null); } }