C#: Restricting Types in method parameters (not generic parameters)

后端 未结 6 688
太阳男子
太阳男子 2020-12-11 03:21

I\'d like to code a function like the following

public void Foo(System.Type t where t : MyClass)
{ ... }

In other words, the argument type

6条回答
提交回复
热议问题