Code inspection: Redundant cast
Last modified: 08 April 2024tip
According to C# documentation, explicit conversion (cast) is redundant in the following cases:
In these cases the cast is done implicitly by the compiler. Needless to say, duplicate casts and casts between the same type are also redundant.
ReSharper suggests removing the explicit cast if no information will be lost in the implicit conversion or if the conversion will always succeed.