I have some curly question..
I can define alias for the class开发者_开发知识库 at top of my document, Such asusing MyName = Bla.Bla.ClassNameBut can I define something like this in the method?
No, you can't. If you mean that you want to define a class alias inside a method, this is not possible.
Alias could be defined only at file or namespace level:
using MyName = Bla.Bla.ClassName;
namespace A{
...
}
or
namespace A{
    using MyName = Bla.Bla.ClassName
...
}
If you instead mean you want to define a "method alias", this also isn't possible: alias are only for types or namespaces.
No, using directives have to either be outside any declaration, or within a namespace declaration:
using Foo;
namespace Bar
{
   using Baz;
}
You can't do this within a method. Why not just do it for the whole class though? Why do you only want it to apply within a particular method?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论