C# 9 adds a whole list of new language features. Most people talk about the support for record types and improved pattern matching but one of the features I’m happy that is finally added to the language are covariant return types.
You are probably asking covariant return what?????
Let’s explain; with return type covariance, you can override a base class method that has a less-specific type with one that returns a more specific type.
An example, before C#9 you would have to return the base type from the inherited class:
In C# 9, you can do the following: