In this code snippet, we will take a look at conversion operator overloading in C#.
Conversion operators can be overloaded just like regular operators. This is useful when you want to be able to convert your custom object to another type. We have two types of conversions, implicit and explicit. Implicit conversion can be “just done” no special syntax is required. Meanwhile, explicit conversion requires casting.
Let’s look at the code example below to see how to overload conversion operators.