Exemplo n.º 1
0
        /// <summary>
        /// 保存数据字典
        /// </summary>
        /// <param name="source"></param>
        private void SaveDictionarys(List <DictionaryModel> source)
        {
            if (VerifyHelper.IsEmpty(source))
            {
                return;
            }

            ShowStatusText("正在保存数据字典信..", isConsoleWrite: false);

            var datas = EngineHelper.Map <List <DictionaryEntity> >(source);

            var genres = datas.GroupBy(x => x.Genre).Select(x => x.Key).ToArray();

            dictionaryService.DeleteByGenres(genres);
            dictionaryService.BatchInsert(datas);
        }