using Newtonsoft.Json.Linq; using System; using System.Linq; using System.Net.Http; using System.Web.Http; namespace WebServer { public class CommonController : BaseController { [HttpGet] public HttpResponseMessage List() { var db = new EEEntities(); var liast = db.Common.Where(t => t.gcode == "EET1P").OrderBy(t => t.code).ToArray(); //System.Web.Http.Results.JsonResult var json = JObject.FromObject(liast); return new HttpResponseMessage() { Content = new StringContent( json.ToString(), System.Text.Encoding.UTF8, "application/json") }; } } }