Shane32.Analyzers
1.0.1
dotnet add package Shane32.Analyzers --version 1.0.1
NuGet\Install-Package Shane32.Analyzers -Version 1.0.1
<PackageReference Include="Shane32.Analyzers" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Shane32.Analyzers --version 1.0.1
#r "nuget: Shane32.Analyzers, 1.0.1"
// Install Shane32.Analyzers as a Cake Addin #addin nuget:?package=Shane32.Analyzers&version=1.0.1 // Install Shane32.Analyzers as a Cake Tool #tool nuget:?package=Shane32.Analyzers&version=1.0.1
Shane32.Analyzers
Analyzers
This package contains a collection of Roslyn analyzers and code fixes that can be used to enforce coding standards and best practices in C# code.
IQueryable
cast analyzer
Prevents casting IQueryable<T>
to IEnumerable<T>
. This is a common mistake that can cause performance issues by preventing the query from being executed asynchronously.
To fix this warning, call ToListAsync()
to asynchronously execute the query before casting it to IEnumerable<T>
.
Explicit casts and AsEnumerable()
calls will not trigger this warning.
- Synchronous
IQueryable
method call analyzer
Prevents calling Queryable
methods that synchronously execute the query such as Single()
or FirstOrDefault()
.
To fix this warning, use the asynchronous version of the method such as SingleAsync()
or FirstOrDefaultAsync()
.
Credits
Glory to Jehovah, Lord of Lords and King of Kings, creator of Heaven and Earth, who through his Son Jesus Christ, has reedemed me to become a child of God. -Shane32
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.