Suamere
Suamere

Reputation: 6248

Difference between Task and void methods (Non Async)

What are the differences between these two methods?

public void DoWork() {}
public Task DoWork() {}

Note I am not using async.

Upvotes: 2

Views: 568

Answers (1)

lem2802
lem2802

Reputation: 1162

public Task DoWork() {} can be awaited in an async call

public void DoWork() {} don't

Upvotes: 3

Related Questions