public DictDto GetByCode(DictTypeEnum dictType, string dictValue) { var dict = _dictRepository.Table.Where(a => a.DictType == dictType.ToString() && a.DictCode == dictValue).FirstOrDefault(); if (dict != null) { return(dict.ToModel()); } return(null); }
/// <summary> /// 重载词库信息 /// </summary> /// <param name="dictType">词库类型</param> internal virtual void Reload(DictTypeEnum dictType) { switch (dictType) { case DictTypeEnum.Text: ReloadTextDict(); break; case DictTypeEnum.PinYin: ReloadPinYinDict(); break; } }
/// <summary> /// 取得字典类型代码 /// </summary> /// <param name="type">DictTypeEnum字典类型枚举</param> /// <returns>字典类型代码</returns> public string GetDictTypeName(DictTypeEnum type) { return(Enum.GetName(typeof(DictTypeEnum), type)); }
public IList <DictEntity> GetListByType(DictTypeEnum dictType) { var query = _dictRepository.Table.Where(a => a.DictType == dictType.ToString()); return(query.ToList()); }
/// <summary> /// 取得字典类型代码 /// </summary> /// <param name="type">DictTypeEnum字典类型枚举</param> /// <returns>字典类型代码</returns> public string GetDictTypeName(DictTypeEnum type) { return Enum.GetName(typeof(DictTypeEnum), type); }