Пример #1
0
        /// <summary>
        /// quice get a unsuccess scream result without data
        /// </summary>
        /// <returns></returns>
        public static ScreamResult Unsuccessful(params string[] errors)
        {
            var result = new ScreamResult(success: false)
            {
                Errors = errors?.ToList() ?? new List <string>(0)
            };

            return(result);
        }
Пример #2
0
        /// <summary>
        /// quice get a success scream result with data
        /// </summary>
        public static ScreamResult <T> Successful <T>(T data)
        {
            var result = new ScreamResult <T>(success: true)
            {
                Data = data
            };

            return(result);
        }
Пример #3
0
        /// <summary>
        /// quice get a unsuccess scream result with data
        /// </summary>
        public static ScreamResult <T> Unsuccessful <T>(T data, params string[] errors)
        {
            var result = new ScreamResult <T>(success: false)
            {
                Data   = data,
                Errors = errors?.ToList() ?? new List <string>(0)
            };

            return(result);
        }