예제 #1
0
        public ApiResponseResult(HttpRequestMessage request, string status, string message = "", object data = null)
        {
            object dataList = string.Empty;

            if (data != null)
            {
                if (!(data is IList))
                {
                    dataList = new List <object>();
                    ((List <object>)dataList).Add(data);
                }
                else
                {
                    dataList = data;
                }
            }

            _returnModel = new ReturnModel()
            {
                Status  = status,
                Message = message,
                Data    = dataList
            };
            _request = request;
        }
예제 #2
0
 public ApiResponseResult(HttpRequestMessage request, ReturnModel model)
 {
     _returnModel = model;
     _request     = request;
 }