I'm trying to call some functionality that requires a type to be passed in a generics situation. I only have a string representation of the type and the assembly that contains the type. Is this possible somehow?
The call:
var typeName = "CustomNamespace.CustomType";
//CustomNamespace.CustomType should be replaced with typeName
Generator.RegisterTemplate<CustomNamespace.CustomType>();
The function:
public void RegisterTemplate<TModel>(string templateName,
string templateString)
{
templateItems[TranslateKey(typeof(TModel), templateName)] =
new RazorTemplateEntry() {
ModelType = typeof(TModel),
TemplateString = templateString,
TemplateName = "Rzr" + Guid.NewGuid().ToString("N")
};
}