csharp get Full Exception message if InnerException is not NULL

Code Example - csharp get Full Exception message if InnerException is not NULL

                
                        public static string GetFullMessage(this Exception ex)
        {
            return ex.InnerException == null
                 ? ex.Message
                 : ex.Message + " --> " + ex.InnerException.GetFullMessage();
        }