as Operator

as Operator

You can use the as operator in C# to convert a class into another class within the same inheritance hierarchy. The as operator is equivalent to using casting with some minor differences as will…