コード例 #1
0
ファイル: TaskExtensions.cs プロジェクト: hpenney2/devcomrade
 public static void Handle(this Exception @this, Action <Exception> handler)
 {
     foreach (var exception in @this.AsEnumerable())
     {
         handler(exception);
     }
 }
コード例 #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));
        }