public List <FunctionRankResult> GetFunctionRank(FunctionRankParms parms) { List <FunctionRankResult> functionRankResults = GetActualFunctionRank(); var orderedFunctionRanks = SetOrder(functionRankResults, parms); return(orderedFunctionRanks); }
private List <FunctionRankResult> SetOrder(List <FunctionRankResult> functionRankResults, FunctionRankParms query) { if (query.RankByAlphabet == 1) { return(functionRankResults.OrderBy(x => x.name).ToList()); } else { return(functionRankResults.OrderByDescending(x => x.value).ToList()); } }