public static string GetDictionaryText(IEnumerable <DictionaryDto> dictionaries, int tag, string value) { string ret = ""; DictionaryDto dictionaryDto = dictionaries.Where(d => d.Tag == tag).FirstOrDefault(); if (dictionaryDto != null) { DictionaryValueDto dictionaryValueDto = dictionaryDto.Values.Where(d => d.Value.Equals(value, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (dictionaryValueDto != null) { ret = dictionaryValueDto.Text; } } return(ret); }
public static string GetDictionaryText(IEnumerable <DictionaryDto> dictionaries, int tag, string value) { string ret = ""; DictionaryDto dictionaryDto = dictionaries.Where(d => d.Tag == tag).FirstOrDefault(); if (dictionaryDto != null) { DictionaryValueDto dictionaryValueDto = dictionaryDto.Values.Where(d => d.Value == value).FirstOrDefault(); if (dictionaryValueDto != null) { ret = dictionaryValueDto.Text; } } return(ret); }