"Remove the unnecessary casting."
You should not use explicit casting code such as (TypeX)someValue where someValue is already implicitly castable to TypeX.
Unnecessary explicit casting is noise in code, and can even decrease performance.
void Foo(int foo)
{
var bar = (int)foo;
}should be 🡻
void Foo(int foo)
{
var bar = foo;
}var bar = (int)Foo();
public int Foo()
{
...
}should be 🡻
var bar = Foo();
public int Foo()
{
...
}