示例#1
0
        private void ById(int status)
        {
            var result = CoreState.ById(status);

            if (result.Result != null && !string.IsNullOrEmpty(result.Result.Message))
            {
                ParseResult(result.Result);
            }
            else if (result.ErrorResult != null)
            {
                ParseErrorResult(result.ErrorResult);
            }
            HttpContextHelper.Accessor.HttpContext.Response.StatusCode = (int)result.ResponseStatus;
        }
示例#2
0
        public static ResponseData GetResponse(this ControllerBase cBase, int code)
        {
            var model = CoreState.ById(code);

            return(GetResult(cBase, model));
        }