Saturday, September 19, 2015

Return Dynamic Object From Web Api


    public HttpResponseMessage Contactz()
        {
            var data = new List();
            data.Add("abc");
            data.Add("abc");
            data.Add("abc");
            data.Add("abc");
            return new HttpResponseMessage
            {
                Content = new StringContent(JArray.FromObject(data).ToString(), Encoding.UTF8, "application/json")
            };
        }

No comments:

Post a Comment