Exemple #1
0
        public static CommonJsonResult Error(IEnumerable<string> errorMessages)
        {
            var data = new CommonJsonResult()
                           {
                               Errors = errorMessages.ToList(),
                               HasErrors = true
                           };
            data.CombinedErrors = string.Join("\n", data.Errors);

            return data;
        }
Exemple #2
0
        public static CommonJsonResult Error(Exception ex)
        {
            var data = new CommonJsonResult()
                       {
                           Errors = new List<string>() { ex.Message },
                           StackTrace = ex.StackTrace,//ExceptionFormatter.Format(ex),
                           HasErrors = true,
                       };
            data.CombinedErrors = string.Join("\n", data.Errors);

            return data;
        }