Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make the asynchronous OnEntry method execute after the execution of the decorated method? #90

Open
CodingOctocat opened this issue Nov 2, 2021 · 1 comment

Comments

@CodingOctocat
Copy link

I found that if the OnEntry method is asynchronous, it will run alternately with the decorated method, which is not the result I want, and I want OnEntry to be executed in its entirety first.

public class AutoGetAccessToken : OnMethodBoundaryAspect
{
    public override async void OnEntry(MethodExecutionArgs arg)
    {
        await RequestOrRefreshAccessTokenAsync();
    }
}

[AutoGetAccessToken]
public async Task<Repo> GetFileAsync()
{
    // ...
}
@Ralf1108
Copy link
Collaborator

Ralf1108 commented Nov 10, 2021

Unfortunately we don't support this.
Your method "GetFileAsync" runs concurrent because there is no Task returned from "OnEntry" so nobody is awaiting the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants