Fix S6966 Awaitable method should be used
Closed this issue · 1 comments
knopa commented
Description
https://rules.sonarsource.com/csharp/RSPEC-6966/
According to their documentation
https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.addasync?view=efcore-8.0
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**.
Repro steps
Any DbSet.Add from entityframework core
Expected behavior
Shoudn't force to use AddAsync or AddRangeAsync
Actual behavior
force to use async version
mary-georgiou-sonarsource commented