advertise with us

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


Grab Your Free C# Cheat Sheet!

Download "C# Essentials: A Developer's Cheat Sheet" for key syntax, tips, and quick references. Perfect for developers of all levels!

👉 Download your free copy now!

Need Help with Your C# Projects?

We offer expert support and development services for projects of any size. Contact us for a free consultation and see how we can help you succeed.

CONTACT US NOW