Omit type name when calling static methods with the using static directive in C#

The using static directive was introduced in C# 6 and allows us to omit the type name when calling static methods… cool right?

but I wouldn’t use this when omitting the type name would result in ambiguity or confusion for the next developer about what class a static method is in.

The examples below are from Microsofts documentation

Leave a Reply

Your email address will not be published.