I declare a class with many typeparams:
public class A<T1, T2, T3, T4, T5> {}
How can I use alias like this:
public class B<T1, T2, T3, T4, T5>
{
开发者_JAVA技巧    using T = A<T1, T2, T3, T4, T5>
    public void Method()
    {
        T.StaticMethod();
    }
}
You can do this with the rest of your using statements:
using MyList = System.Collections.Generic.Dictionary<int, string>;
Then you can use the class like so:
MyList x = new MyList();
x.Add(0, "Hello World");
However, this is kinda bad design. In the example you posted, B still had 5 generic type arguments, so nothing much is gained.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论