-
Notifications
You must be signed in to change notification settings - Fork 465
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
Don't emit CA1849 for DbContext methods #6719
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6719 +/- ##
=======================================
Coverage 96.36% 96.36%
=======================================
Files 1395 1395
Lines 325148 325211 +63
Branches 10678 10679 +1
=======================================
+ Hits 313323 313398 +75
+ Misses 9254 9245 -9
+ Partials 2571 2568 -3 |
The build is complaining that there is a missing entry in |
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContext.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContext.cs
Outdated
Show resolved
Hide resolved
...Analyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContextTests.cs
Outdated
Show resolved
Hide resolved
Strange, usually it complains when there is an entry that needs to be removed because the corresponding doc is added. Anyway, better to run the |
I ran that command already and no changes were made, which makes sense. I can try again tomorrow. |
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContext.cs
Outdated
Show resolved
Hide resolved
…syncMethodInAsyncContext.cs
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContext.cs
Show resolved
Hide resolved
…syncMethodInAsyncContext.cs
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContext.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @CollinAlpert!
Do we know if this is already shipped with a .NET8 preview? Or it will land in next one? |
Will this only ship with a .NET 8 SDK, or will it also be included in a .NET 7 SDK update? |
It should have included in .NET 8 preview 7, it is not ported to .NET 7 |
I get a lot of CA1849 warnings with .NET 8 Preview 7 for my DbSet.Add(..) calls.. I created an PR here: #6858 |
This PR adds exclusions for the
DbContext.Add()
andDbContext.AddRange()
methods and fixes a false negative forIDbContextFactory<DbContext>.CreateDbContext()
in theUseAsyncMethodInAsyncContext
analyzer.Fixes #6684.