示例#1
0
        public static ResponseViewModel <T> GetErrorResult(ResponseResultTypes resultType, string message)
        {
            List <string> exceptions = new List <string> {
                message
            };

            return(GetResult(resultType, message, null, exceptions));
        }
示例#2
0
        public static ResponseViewModel <T> GetResult(ResponseResultTypes type, string message, T data, IList <string> errors)
        {
            ResponseViewModel <T> response = new ResponseViewModel <T>
            {
                StatusCode = $"{(int)type}",
                Message    = message,
                Data       = data,
                Errors     = errors
            };

            return(response);
        }
示例#3
0
        public static ResponseViewModelWithAction <T> GetResult(ResponseResultTypes type, string message, T data, IList <string> errors, bool isRestore)
        {
            ResponseViewModelWithAction <T> response = new ResponseViewModelWithAction <T>
            {
                StatusCode     = $"{(int)type}",
                Message        = message,
                Data           = data,
                Errors         = errors,
                ActionRequired = isRestore
            };

            return(response);
        }