JetBrains / ExternalAnnotations

JetBrains ReSharper External Annotations
https://www.jetbrains.com/help/resharper/Code_Analysis__External_Annotations.html
MIT License
81 stars 44 forks source link

[InstantHandle] annotations for collections passed in DbSet methods #176

Closed TessenR closed 4 years ago

TessenR commented 5 years ago

https://www.entityframeworktutorial.net/efcore/entity-framework-core-dbcontext.aspx

methods like .AddRange, .AddRangeAsync, .AttachRange, .RemoveRange, .UpdateRange should have [InstantHandle] annotation for their collection parameters.

Note that similar methods in non-netcore ef should be annotated as well.

Due to lack of these annotations R#/Rider currently issue incorrect access to modified closure warnings in code like this:

image