Efcore: Use Task.FromResult consistently

Created on 19 Jan 2017  路  11Comments  路  Source: dotnet/efcore

For methods returning a non-generic Task we should always use Task.FromResult(true)

closed-fixed good first issue punted-for-3.0 type-cleanup

Most helpful comment

Use Task.CompletedTask

All 11 comments

@benaadams Yeah, that's even better

Use Task.CompletedTask

https://github.com/aspnet/EntityFrameworkCore/blob/24b9aa1d2e14fe2e737255ede9b2a7a623fcf2af/src/EFCore/ChangeTracking/NavigationEntry.cs#L131

Unable to find any other place where we are returning non-generic task and not using Task.CompletedTask.

Close?

Who will update that one reference? :trollface:

Well I'm technically assigned to it, so......

Unassigned. I think we can leave it to good-first-issue or if someone in the team wants to do this.

@AsifulNobel - Go ahead. Yes, those methods should also be updated. I must have missed them in GitHub search. Update all the methods which are returning non-generic task and using Task.FromResult(0)

Was this page helpful?
0 / 5 - 0 ratings