Skip to content

Instantly share code, notes, and snippets.

@MichalGrzegorzak
Created July 17, 2023 12:33
Show Gist options
  • Save MichalGrzegorzak/c2ee43fad625f36cac8d2a8acf58708c to your computer and use it in GitHub Desktop.
Save MichalGrzegorzak/c2ee43fad625f36cac8d2a8acf58708c to your computer and use it in GitHub Desktop.
Reflection, create specific generic type
var baseGenericType = typeof(BaseItemCollection<>);
var genType = tt.GetGenericArguments()[0];
var specificBaseType = baseGenericType.MakeGenericType(genType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment