EF Core DbSet AddAsync method: Should the async method be used in 100% of the cases?

Viewed 723

The documentation on the AddAsync method states that

This method is async only to allow special value generators, such as the one used by 'Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy.SequenceHiLo', to access the database asynchronously. For all other cases the non async method should be used.

Is this still up to date, as the method does return a ValueTask and thus, in the synchronous way there should be no further Task-related allocations?

Update / Follow-up question

Why does AddRangeAsync not return a ValueTask (Documentation)?

0 Answers
Related