Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#-跳过泛型_C#_Generics_Skip - Fatal编程技术网

C#-跳过泛型

C#-跳过泛型,c#,generics,skip,C#,Generics,Skip,如何在方法中传递泛型类型的参数 public Type<T, U, V> { ... } public void Method(??? arg) // where ??? is Type<T, U, V> { ... } 公共类型{…} 公共作废方法(?arg)//在哪里???是类型 { ... } 将泛型参数带到方法定义中 public void Method<T,U,V>(Type<T,U,V> arg) // where ??? is

如何在方法中传递泛型类型的参数

public Type<T, U, V> { ... }

public void Method(??? arg) // where ??? is Type<T, U, V>
{
  ...
}
公共类型{…}
公共作废方法(?arg)//在哪里???是类型
{
...
}

将泛型参数带到方法定义中

public void Method<T,U,V>(Type<T,U,V> arg) // where ??? is Type<T, U, V>
{
  ...
}
public void方法(类型arg)//在哪里???是类型
{
...
}

您必须使方法本身具有通用性:

public void Method<T, U, V>(Type<T, U, V> arg) {
  // ...
}
公共作废方法(arg类型){
// ...
}
公共类型{…}
公共无效方法(arg类型)
{
...
}

不要回答我们的问题。你能提供更多关于你想做什么的细节吗?
public Type<T, U, V> { ... }

public void Method<T, U, V>(Type<T, U, V> arg)
{
    ...
}