Beispiel #1
0
 public static void Handle(this Exception @this, Action <Exception> handler)
 {
     foreach (var exception in @this.AsEnumerable())
     {
         handler(exception);
     }
 }
Beispiel #2
0
        public void AsEnumerable()
        {
            var exp = new Exception("MsgA", new Exception("MsgB"));

            var group = exp.AsEnumerable(item => item.InnerException)
                        .ToList();

            Assert.Equal("MsgA,MsgB", group.JoinStr(",", item => item.Message));
        }