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

Support System.Threading.Tasks.Task methods like GetAwaiter().GetResult() #37

Open
maca88 opened this issue Jul 19, 2017 · 0 comments
Open

Comments

@maca88
Copy link
Owner

maca88 commented Jul 19, 2017

Convert:

Task.Run(() => DoSomething()).Wait();
Task.Run(() => DoSomething2()).Result;
Task.Run(() => DoSomething3()).GetAwaiter().GetResult();

to

Task.Run(() => DoSomething()).Wait();
Task.Run(() => DoSomething2()).Result;
await Task.Run(() => DoSomething3());

.Wait() and .Result shouldn't be converted to async, because they will throw an AggregateException that contains the actual exception, when an exception occurs.

@maca88 maca88 changed the title Support System.Threading.Tasks.Task methods like Wait() Support System.Threading.Tasks.Task methods like GetAwaiter().GetResult() Nov 4, 2017
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

1 participant