I have some curly question..
I can define alias for the class at top of my document, Such as
using MyName = Bla.Bla.ClassName
But can I define something like this in the method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
or
If you instead mean you want to define a “method alias”, this also isn’t possible: alias are only for types or namespaces.