samedi 5 décembre 2015

Get type of generic parameter from class which is inherited from generic interface

I have this interface and its implementation:

public interface IInterface<TParam>
{
    void Execute(TParam param);
}

public class Impl : IInterface<int>
{
    public void Execute(int param);
    {
        ...
    }
}

How to get TParam type using reflection from typeof(Impl)?





Aucun commentaire:

Enregistrer un commentaire