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

后端 未结 9 1417
挽巷
挽巷 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:18

    I suppose you could make all of your methods in utils.cs as extension methods to the object class, but you'd still have to prefix your methods with "this.", which is probably not what you want.

提交回复
热议问题