How to “import” a static class in C#?

后端 未结 9 1363
挽巷
挽巷 2020-12-28 19:08

I have created a public static class utils.cs I want to use it in other classes without prefixing method with utils, what\'s the syntax to do this ?

9条回答
  •  有刺的猬
    2020-12-28 19:30

    With C# 6, you can now use static imports (see msdn) For example,

    using static Utils;
    

提交回复
热议问题