Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S6966 Awaitable method should be used #9366

Closed
knopa opened this issue May 30, 2024 · 1 comment
Closed

Fix S6966 Awaitable method should be used #9366

knopa opened this issue May 30, 2024 · 1 comment

Comments

@knopa
Copy link

knopa commented May 30, 2024

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
Copy link
Contributor

Hello @knopa - this FP has already been fixed in #9269. The fix will come with the next release.

@mary-georgiou-sonarsource mary-georgiou-sonarsource removed their assignment May 31, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants