Common Practices and Code Improvements
- Check for reference equality instead
Check for reference equality instead.
- Convert property to auto-property
Convert property to auto-property.
- Convert property to auto-property when possible
Convert property to auto-property when possible.
- Convert property to auto-property with private setter
Convert property to auto-property with private setter.
- Possible mistaken argument
Possible mistaken argument.
- Possible mistaken call to GetType()
Possible mistaken call to GetType().
- Remove ToList()
Remove ToList().
- Replace with FirstOrDefault($args$)
Replace with FirstOrDefault($args$).
- Replace with LastOrDefault($args$)
Replace with LastOrDefault($args$).
- Replace with OfType<T>() (replace with OfType(Of ..)())
Replace with OfType<T>() (replace with OfType(Of ..)()).
- Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any())
Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any()).
- Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..))
Replace with OfType<T>().Any() (replace with OfType(Of ..)().Any(..)).
- Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count())
Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count()).
- Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..))
Replace with OfType<T>().Count() (replace with OfType(Of ..)().Count(..)).
- Replace with OfType<T>().First() (replace with OfType(Of ..)().First())
Replace with OfType<T>().First() (replace with OfType(Of ..)().First()).
- Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..))
Replace with OfType<T>().First() (replace with OfType(Of ..)().First(..)).
- Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault())
Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault()).
- Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..))
Replace with OfType<T>().FirstOrDefault() (replace with OfType(Of ..)().FirstOrDefault(..)).
- Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last())
Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last()).
- Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..))
Replace with OfType<T>().Last() (replace with OfType(Of ..)().Last(..)).
- Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault())
Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault()).
- Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..))
Replace with OfType<T>().LastOrDefault() (replace with OfType(Of ..)().LastOrDefault(..)).
- Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single())
Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single()).
- Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..))
Replace with OfType<T>().Single() (replace with OfType(Of ..)().Single(..)).
- Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault())
Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault()).
- Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..))
Replace with OfType<T>().SingleOrDefault() (replace with OfType(Of ..)().SingleOrDefault(..)).
- Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..))
Replace with OfType<T>().Where() (replace with OfType(Of ..)().Where(..)).
- Replace with single assignment
Replace with single assignment.
- Replace with single call to Any(..)
Replace with single call to Any(..).
- Replace with single call to Count(..)
Replace with single call to Count(..).
- Replace with single call to First(..)
Replace with single call to First(..).
- Replace with single call to FirstOrDefault(..)
Replace with single call to FirstOrDefault(..).
- Replace with single call to Last(..)
Replace with single call to Last(..).
- Replace with single call to LastOrDefault(..)
Replace with single call to LastOrDefault(..).
- Replace with single call to Single(..)
Replace with single call to Single(..).
- Replace with single call to SingleOrDefault(..)
Replace with single call to SingleOrDefault(..).
- Replace with SingleOrDefault($args$)
Replace with SingleOrDefault($args$).
- Simplify 'IIf'
Simplify 'IIf'.
- Simplify conditional operator
Simplify conditional operator.
- Simplify expression
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)
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)
String.LastIndexOf is culture-specific (string.LastIndexOf(string) is culture-specific).
- String.LastIndexOf is culture-specific (string.LastIndexOf(string, int) is culture-specific)
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
Use 'TypeOf .
- Use array creation expression
Use array creation expression.
- Use First() instead
Use First() instead.
- Use method Any()
Use method Any().
- Use method IsInstanceOfType(..)
Use method IsInstanceOfType(..).