You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FYI there are 90 individual projects in the EntityFramework.Docs\samples\core, but the Samples.sln only contains 85 projects. The missing projects are
EFGetStarted.Android
EFGetStarted (Xamarin)
EFGetStarted.iOS
GetStartedWinForms
GetStartedWPF
which should probably be included (for reader interest and to ensure CI testing).
VS analyzers (plus my favourite Roslynator.Analyzers giving RCS1234 messages) spit out an alarming number of Warning/Messages
which is not a happy UX for those of nervous disposition.
Inevitably some are new .NET 8.0 and C# v11 magic (like "Use primary constructor"), but there are many ".. can be simplified" that suggests the EF samples are lagging behind reasonable professional dev progress and expectation
num
qty
code
Description
1
138
CA1050
Declare types in namespaces (cf RCS1110 below)
2
7
CA1806
'Split_query_for_non_navigation_collections' calls 'ToList' but does not use the value the method returns.
3
5
CA1816
Change PublicPooledDbContextFactorySample.SomeDbContext.Dispose() to call GC.SuppressFinalize(object).
4
33
CA1822
Member 'LoadEntities' does not access instance data and can be marked as static
5
14
CA1826
Do not use Enumerable methods on indexable collections. Instead use the collection directly.
6
1
CA1829
Use the "Count" property instead of Enumerable.Count()
7
6
CA1845
Use span-based 'string.Concat' and 'AsSpan' instead of 'Substring'
8
2
CA1847
Use 'string.Contains(char)' instead of 'string.Contains(string)' when searching for a single character
9
2
CA1859
Change type of variable 'searchIds' from 'System.Collections.Generic.IReadOnlySet' to 'System.Collections.Generic.HashSet' for improved performance
10
3
CA1860
Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
11
19
CA1861
Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array
12
1
CA1862
Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison
13
13
CA1866
Use 'string.StartsWith(char)' instead of 'string.StartsWith(string)' when you have a string with a single char
14
1
CA1869
Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
15
1
CA2016
Forward the 'cancellationToken' parameter to the 'SaveChangesAsync' method or pass in 'CancellationToken.None' ..
16
1
CA2208
Call the ArgumentOutOfRangeException constructor that contains a message and/or paramName parameter
17
2
CA2211
Non-constant fields should not be visible
18
2
CA2254
The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, EventId, string?, params object?[])'
19
1
EF1002
Method 'FromSqlRaw' inserts interpolated strings directly into the SQL, without any protection against SQL injection. Consider using 'FromSql' instead
20
1
IDE0025
Use expression body for property
21
2
IDE0027
Use expression body for accessor
22
171
IDE0028
Collection initialization can be simplified
23
1
SIDE0037
Member name can be simplified
24
6
IDE0040
Accessibility modifiers required
25
2
IDE0044
Make field readonly
26
1
IDE0046
'if' statement can be simplified
27
10
IDE0051
Private member 'LaundryBasket._id' is unused
28
8
IDE0052
Private member 'MyController._context' can be removed as the value assigned to it is never read
29
58
IDE0053
Use expression body for lambda expression
30
15
IDE0057
Substring can be simplified
31
37
IDE0060
Remove unused parameter 'args' if it is not part of a shipped public API
32
1
IDE0061
Use expression body for local function
33
10
IDE0062
Local function can be made static
34
6
IDE0063
'using' statement can be simplified
35
1
IDE0066
Use 'switch' expression
36
17
IDE0071
Interpolation can be simplified
37
14
IDE0079
Remove unnecessary suppression
38
1
IDE0083
Use pattern matching
39
63
IDE0090
'new' expression can be simplified
40
196
IDE0290
Use primary constructor
41
55
IDE0300
Collection initialization can be simplified
42
8
IDE0305
Collection initialization can be simplified
42
8
IDE1006
Naming rule violation: Missing prefix: '_'
43
40
RCS1021
Use expression-bodied lambda
44
9
RCS1036
Remove unnecessary blank line
45
308
RCS1037
Remove trailing white-space
46
5
RCS1075
Avoid empty catch clause that catches System.Exception
47
9
RCS1077
Optimize LINQ method call
48
1
RCS1084
Use coalesce expression instead of conditional expression
FYI there are 90 individual projects in the EntityFramework.Docs\samples\core, but the Samples.sln only contains 85 projects. The missing projects are
which should probably be included (for reader interest and to ensure CI testing).
VS analyzers (plus my favourite Roslynator.Analyzers giving RCS1234 messages) spit out an alarming number of Warning/Messages
which is not a happy UX for those of nervous disposition.
Inevitably some are new .NET 8.0 and C# v11 magic (like "Use primary constructor"), but there are many ".. can be simplified" that suggests the EF samples are lagging behind reasonable professional dev progress and expectation
N.B. this is with the standard .editorconfig in the parent folder (so is not anything I have smuggled in with my VS option prefs) !
IMHO the docs should reflect the latest and greatest guidelines, and not be tied to backward compat to legacy C# / FW releases
I propose to work up a PR to eliminate/minimise these banshees, unless EF Team declare already on the case to deter me.
The text was updated successfully, but these errors were encountered: