public HttpResponseMessage GetAllRiskRatingCode(HttpRequestMessage request) { return(GetHttpResponse(request, () => { string[] riskRatingCode = _LoanService.GetRiskRatingCode(); var model = new List <KeyValueData>(); foreach (var s in riskRatingCode) { model.Add(new KeyValueData() { Key = s, Value = s }); } return request.CreateResponse <KeyValueData[]>(HttpStatusCode.OK, model.ToArray()); // return request.CreateResponse<string[]>(HttpStatusCode.OK, riskRatingCode); })); }