예제 #1
0
        protected HttpResponseMessage CreateResponseMessage <T>(HttpBackCode code, T data, string message = null)
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK);
            var back     = new HttpBackResult <T> {
                Status = (int)code, Msg = message == null?code.GetDescribeInfo() : message, Data = data
            };

            response.Content = new StringContent(back.ToJson());
            return(response);
        }
예제 #2
0
        protected HttpResponseMessage CreateResponseMessage(HttpBackCode code)
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK);
            var back     = new HttpBackResult <string> {
                Status = (int)code, Msg = code.GetDescribeInfo(), Data = null
            };

            response.Content = new StringContent(back.ToJson());
            return(response);
        }