void Main()
{
GetTypeFromList(new List<string>()).Dump();
GetTypeFromFunc((string s, int i) => true).Dump();
}
public Type GetTypeFromList<TType>(IEnumerable<TType> dummy)
{
return typeof(TType);
}
public Type[] GetTypeFromFunc<T1, T2, TOut>(Func<T1, T2, TOut> dummy)
{
return new [] { typeof(T1), typeof(T2), typeof(TOut) };
}
Created
August 8, 2014 11:28
-
-
Save SeriousM/bf5d9558d4481538b7b7 to your computer and use it in GitHub Desktop.
Extract Generic Type Definition in C#
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment