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

Avoid using Task.Run in ASP.Net Core #5

Open
nimadir opened this issue Feb 4, 2022 · 0 comments
Open

Avoid using Task.Run in ASP.Net Core #5

nimadir opened this issue Feb 4, 2022 · 0 comments

Comments

@nimadir
Copy link

nimadir commented Feb 4, 2022

Hi dear filip

I have seen your video and in one wideo you said we should use Task.Run to convert a sync method to async version.

I have read this article : ASP.NET Core Performance Best Practices

In a paragraph has been said: Do not use Task.Run to make a synchronous API asynchronous.

I have ask a similar question in stackoverflow: Using Task.Run in ASP.Net Core

I'm confused and I want to know:

  1. How can I convert a sync method to async version in ASP.Net Core?
  2. If there is no async version of a method should we write sync web method?
  3. What is the best way to write async method?

Thanks

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

No branches or pull requests

1 participant