According to the Section II metadata specification for the GenericParamConstraint table for the CLR,
The GenericParamConstraint table records the constraints for each common parameter. Each generic parameter can be limited to receive from zero or one class. Each generic parameter may be limited to implement zero or more interfaces.
The problem is that I cannot find the correct C # code snippet so that the C # compiler generates a single row in the GenericParamConstraint table. I tried using
public interface IFoo
{
}
public interface IBaz
{
}
public interface IBar
{
}
public class Foo
{
}
public class SampleClassWithGenericParamConstraint<T>
where T : IFoo, IBaz, new()
{
public void DoSomething<U>(U arg1)
where U : struct
{
}
}
class Program
{
static void Main(string[] args)
{
}
}
.. , # GenericParam GenericParamConstraint. , : - , #, # GenericParamConstraint, ? - #, ILASM, ?