0

Consider this asynchronous method:

public async Task<Data> AnotherMethodAsync()
{
    var reader = await GetData();
    reeturn Convert(reader);
}

Now I want to call this from another method. If the call is a simple call through or no work is being done after the call, what is the difference between these two examples:

Return Task

public Task<Data> SomeMethodAsync()
{
    return AnotherMotherAsync();
}

Async/Await

public async Task<Data> SomeMethodAsync()
{
    await AnotherMotherAsync();
}

Is the one more correct than the other? Is there any performance considerations?

4

0 回答 0