public List <KeyValue> GetAllKeyValueByKeyTypeIntCode(string keyTypeIntCode) { List <KeyValue> list = new List <KeyValue>(); KeyType keyType = DictionaryKeyType.Where(d => d.Value.KeyTypeIntCode == keyTypeIntCode).FirstOrDefault().Value; foreach (var item in DictionaryKeyValue.Where(k => k.Value.idKeyType == keyType.idKeyType).OrderBy(o => o.Value.Name).ToList()) { list.Add(item.Value); } return(list); }
public List <KeyValue> GetAllKeyValueByKeyTypeIntCode(string keyTypeIntCode, string columnToOrderBy) { List <KeyValue> list = new List <KeyValue>(); KeyType keyType = DictionaryKeyType.Where(d => d.Value.KeyTypeIntCode == keyTypeIntCode).FirstOrDefault().Value; var data = DictionaryKeyValue.Where(k => k.Value.idKeyType == keyType.idKeyType).OrderBy(o => o.Value.Name).Select(s => s.Value).ToList(); data = BaseClassBL <KeyValue> .Sort(data, columnToOrderBy, Constants.SORTING_ASC).ToList(); foreach (var item in data) { list.Add(item); } return(list); }