Inspectopedia 2025.2 Help

Common Practices and Code Improvements

Check for reference equality instead  

Check for reference equality instead.

Convert property to auto-property   New in this release

Convert property to auto-property.

Convert property to auto-property when possible   New in this release

Convert property to auto-property when possible.

Convert property to auto-property with private setter   New in this release

Convert property to auto-property with private setter.

Possible mistaken argument   New in this release

Possible mistaken argument.

Possible mistaken call to GetType()   New in this release

Possible mistaken call to GetType().

Remove ToList()   New in this release

Remove ToList().

Replace with FirstOrDefault($args$)   New in this release

Replace with FirstOrDefault($args$).

Replace with LastOrDefault($args$)  

Replace with LastOrDefault($args$).

Replace with OfType<T>() (replace with OfType(Of ..)())   New in this release

Replace with OfType<T>() (replace with OfType(Of ..)()).

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any())   New in this release

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any()).

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..))   New in this release

Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..)).

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count())   New in this release

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count()).

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..))   New in this release

Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..)).

Replace with OfType<T>().First() (replace with OfType(Of ..)().First())   New in this release

Replace with OfType<T>().First() (replace with OfType(Of ..)().First()).

Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..))   New in this release

Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..)).

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault())   New in this release

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault()).

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..))   New in this release

Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..)).

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last())   New in this release

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last()).

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..))   New in this release

Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..)).

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault())   New in this release

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault()).

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..))   New in this release

Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..)).

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single())   New in this release

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single()).

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..))   New in this release

Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..)).

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault())   New in this release

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault()).

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..))   New in this release

Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..)).

Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..))   New in this release

Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..)).

Replace with single assignment   New in this release

Replace with single assignment.

Replace with single call to Any(..)   New in this release

Replace with single call to Any(..).

Replace with single call to Count(..)   New in this release

Replace with single call to Count(..).

Replace with single call to First(..)   New in this release

Replace with single call to First(..).

Replace with single call to FirstOrDefault(..)   New in this release

Replace with single call to FirstOrDefault(..).

Replace with single call to Last(..)   New in this release

Replace with single call to Last(..).

Replace with single call to LastOrDefault(..)   New in this release

Replace with single call to LastOrDefault(..).

Replace with single call to Single(..)  

Replace with single call to Single(..).

Replace with single call to SingleOrDefault(..)   New in this release

Replace with single call to SingleOrDefault(..).

Replace with SingleOrDefault($args$)  

Replace with SingleOrDefault($args$).

Simplify 'IIf'   New in this release

Simplify 'IIf'.

Simplify conditional operator   New in this release

Simplify conditional operator.

Simplify expression   New in this release

Simplify expression.

String.Compare is culture-specific (string.Compare(string, int, string, int) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, int, string, int) is culture-specific).

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, int, string, int, bool) is culture-specific).

String.Compare is culture-specific (string.Compare(string, string) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, string) is culture-specific).

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific)  

String.Compare is culture-specific (string.Compare(string, string, bool) is culture-specific).

String.CompareTo is culture-specific  

String.CompareTo is culture-specific.

String.EndsWith is culture-specific (string.EndsWith(string) is culture-specific)   New in this release

String.EndsWith is culture-specific (string.EndsWith(string) is culture-specific).

String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific)  

String.IndexOf is culture-specific (string.IndexOf(string) is culture-specific).

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific)  

String.IndexOf is culture-specific (string.IndexOf(string, int) is culture-specific).

String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific)   New in this release

String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific).

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific)   New in this release

String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific).

String.StartsWith is culture-specific (string.StartsWith(string) is culture-specific)  

String.StartsWith is culture-specific (string.StartsWith(string) is culture-specific).

Use 'TypeOf .. Is ..' operator   New in this release

Use 'TypeOf .

Use array creation expression  

Use array creation expression.

Use First() instead   New in this release

Use First() instead.

Use method Any()   New in this release

Use method Any().

Use method IsInstanceOfType(..)   New in this release

Use method IsInstanceOfType(..).

Last modified: 29 July 2025