Use static function from a class without naming the class

前端 未结 4 1700
轻奢々
轻奢々 2021-01-20 16:54

How can I access functions from a class without having to name that class every time? I know how to use \"using\" so that I don\'t have to name the namespace but I was hopin

4条回答
  •  星月不相逢
    2021-01-20 17:20

    I routinely have

    static Action o = s => Console.WriteLine(s);
    
    
    

    in my code which makes debug output so much less noisy. That way I can call Console's static Writeline() much easier. Would that help?

    提交回复
    热议问题