/// <summary>
/// 重写回传的处理
/// </summary>
/// <param name="actionExecutedContext"></param>
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
{
// 
//if ( actionExecutedContext.ActionContext != null )
//{
// var mm = (actionExecutedContext.ActionContext.Response.Content as ObjectContent).Value;
 
//重新封装返回值
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new ObjectContent(result.GetType(), result, new JsonMediaTypeFormatter())
};
actionExecutedContext.Response = response;
}
base.OnActionExecuted(actionExecutedContext);
}

posted on 2020-02-10 12:16  wxm3177  阅读(167)  评论(0编辑  收藏  举报