C#: Use a namespace for a specific block of code?

后端 未结 8 1525
天涯浪人
天涯浪人 2021-01-17 12:21

I just have a point of curiosity. I\'m working with SSRS and calling its SOAP methods. I\'ve got stubs generated / Web references created and that\'s all working fine and I

相关标签:
8条回答
  • 2021-01-17 12:55

    Another little-known C# feature that might interest you, and is similar to Martin's answer, is essentially aliasing a class in the Imports blocks:

    using ListOfDictionary = System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, string>>;
    

    and declare it as

    ListOfDictionary list = new ListOfDictionary();
    

    Note This feature, and sample, were found in another question; specifically: Hidden Features of C#?

    0 讨论(0)
  • 2021-01-17 12:59

    Unfortunately not. There's no such syntax to address this need.

    0 讨论(0)
提交回复
热议问题