本文整理汇总了C#中AggregateException.GetBaseException方法的典型用法代码示例。如果您正苦于以下问题:C# AggregateException.GetBaseException方法的具体用法?C# AggregateException.GetBaseException怎么用?C# AggregateException.GetBaseException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AggregateException
的用法示例。
在下文中一共展示了AggregateException.GetBaseException方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleInnerExceptionTestCase
public void SimpleInnerExceptionTestCase ()
{
var message = "Foo";
var inner = new ApplicationException (message);
var ex = new AggregateException (inner);
Assert.IsNotNull (ex.InnerException);
Assert.IsNotNull (ex.InnerExceptions);
Assert.AreEqual (inner, ex.InnerException);
Assert.AreEqual (1, ex.InnerExceptions.Count);
Assert.AreEqual (inner, ex.InnerExceptions[0]);
Assert.AreEqual (message, ex.InnerException.Message);
Assert.AreEqual (inner, ex.GetBaseException ());
}
示例2: OnDisconnectError
private static void OnDisconnectError(AggregateException ex, object state)
{
((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to raise disconnect: " + ex.GetBaseException());
}
示例3: OnKeepAliveError
private static void OnKeepAliveError(AggregateException ex, object state)
{
((TraceSource)state).TraceEvent(TraceEventType.Error, 0, "Failed to send keep alive: " + ex.GetBaseException());
}
示例4: GetBaseWithInner
public void GetBaseWithInner ()
{
var ae = new AggregateException ("x", new [] { new ArgumentException (), new ArgumentNullException () });
Assert.AreEqual (ae, ae.GetBaseException (), "#1");
var expected = new ArgumentException ();
var ae2 = new AggregateException ("x", new AggregateException (expected, new Exception ()));
Assert.AreEqual (expected, ae2.GetBaseException ().InnerException, "#2");
}
示例5: OnDisconnectError
private static void OnDisconnectError(AggregateException ex, object state)
{
((ILogger)state).LogError("Failed to raise disconnect: " + ex.GetBaseException());
}
开发者ID:FabianGosebrink,项目名称:ASPNET-Core-Angular2-SignalR-Typescript,代码行数:4,代码来源:TransportDisconnectBase.cs
示例6: OnKeepAliveError
private static void OnKeepAliveError(AggregateException ex, object state)
{
((ILogger)state).LogError("Failed to send keep alive: " + ex.GetBaseException());
}