Hi,
I have a delegate for reporting errors, I'm porting it from a .NET Framework Class and it's the only thing remaining to fix.
This is where the invoke is happening async:
/// <summary> /// Reports an error that happened in a threading environment /// </summary> /// <param name="sender">The sender object</param> /// <param name="ex">The exception that happened</param> /// <returns>True if the error could be passed on; false otherwise</returns> public static bool ReportError(object sender, Exception ex) { var SevereErrorHappenedEvent = SevereErrorHappened; if (SevereErrorHappenedEvent == null) return false; else { SevereErrorHappenedEvent.BeginInvoke(sender, ex, (a) => { var ar = a as AsyncResult; var invokedMethod = ar.AsyncDelegate as GeneralExceptionHandler; invokedMethod.EndInvoke(a); }, null); return true; } }
The ServerErrorHappened typed as:
public static event GeneralExceptionHandler SevereErrorHappened;
And the declaration:
/// <summary> /// A delegate to inform of exceptions /// </summary> /// <param name="sender">The sender of this event</param> /// <param name="ex">The exception</param> public delegate void GeneralExceptionHandler(object sender, Exception ex);
What is the equivalent for .NET Core?