Get Started
No framework information available.
README
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.
IQueryablecast 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
IQueryablemethod 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().
- Async methods must have CancellationToken parameter analyzer
Ensures that methods ending with "Async" in non-Controller classes have a CancellationToken parameter. This enforces the best practice of supporting cancellation in all asynchronous operations.
To fix this warning, add a CancellationToken parameter to the method signature. The parameter can be optional with a default value of default.
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
Downloads by Version
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.