1234567891011121314151617181920212223242526 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.AspNetCore.Http;
- using Newtonsoft.Json.Linq;
- namespace SupplierWeb.Commonss
- {
- public class JSONNetResult : ActionResult
- {
- private readonly JObject _data;
- public JSONNetResult(JObject data)
- {
- _data = data;
- }
- public async override void ExecuteResult(ActionContext context)
- {
- var response = context.HttpContext.Response;
- response.ContentType = "application/json";
- await response.WriteAsync(_data.ToString(Newtonsoft.Json.Formatting.None));
- }
- }
- }
|