Skip to content

Instantly share code, notes, and snippets.

@lmatt-bit
Created April 9, 2014 11:27
Show Gist options
  • Select an option

  • Save lmatt-bit/10257526 to your computer and use it in GitHub Desktop.

Select an option

Save lmatt-bit/10257526 to your computer and use it in GitHub Desktop.
Call generic template method from name rather than template
Type type = SchemaAssemblyUtility.GetType(schemaName);
var method = typeof(SchemaContext).GetMethod("CreateModel");
var genericMethod = method.MakeGenericMethod(type);//Here use type
return genericMethod.Invoke(schemaContext, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment