Created
February 1, 2019 13:10
-
-
Save kevingosse/836ce9f72e59648c278247b35dfaeef4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var continuationWrapper = func.Target; | |
var continuation = continuationWrapper.GetType().GetField("_continuation", BindingFlags.Instance | BindingFlags.NonPublic) | |
.GetValue(continuationWrapper) as Action; | |
if (continuation != null) | |
{ | |
var asyncStateMachineBox = continuation.Target; | |
var stateMachineField = asyncStateMachineBox?.GetType().GetField("StateMachine"); | |
if (stateMachineField != null) | |
{ | |
var stateMachine = stateMachineField.GetValue(asyncStateMachineBox); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment