C# “as” cast vs classic cast [duplicate]
With the “classic” method, if the cast fails, an InvalidCastException is thrown. With the as method, it results in null, which can be checked for, and avoid an exception being thrown. Also, you can only use as with reference types, so if you are typecasting to a value type, you must still use the “classic” … Read more