public static string GetAllMessages(this System.Exception exception) { var messages = exception.FromHierarchy(ex => ex.InnerException) .Select(ex => ex.Message); return(string.Join(Environment.NewLine, messages)); }
private static ModelException BuildExeption(System.Exception err, string request) => new ModelException { msg = err.FromHierarchy(ex => ex.InnerException).Select(ex => ex.Message), request = request, source = err.Source, stackTrace = err.StackTrace, targetSite = err.TargetSite?.DeclaringType.ToString(), };
public static string GetaAllMessages(this System.Exception exception) => string.Join(Environment.NewLine, exception.FromHierarchy(ex => ex.InnerException).Select(ex => ex.Message));