임현대수석님 건의사항 적용.
This commit is contained in:
34
SubProject/WebServer/Controller/CommonController.cs
Normal file
34
SubProject/WebServer/Controller/CommonController.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
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<string>
|
||||
var json = JObject.FromObject(liast);
|
||||
return new HttpResponseMessage()
|
||||
{
|
||||
Content = new StringContent(
|
||||
json.ToString(),
|
||||
System.Text.Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user