This project is read-only.

Why is the generic argument needed on Parse<T>?

Aug 21, 2012 at 11:03 AM

First off, great tool - keep up the great work.

I have a requieremnt to call RazorEngine.Parse<T>(string template, T model) without knowing the derived type - I only know the base type.  If I call this method passing in the base type as the model, I get an error if my template references any properties on the derived type.

I have got round this by using reflection at the entry point to work out the derived type using baseType.GetType() and parsing this in as the generic parameter.  Would a method interface which could work out the derived type make sence, or am I just doing something wrong (fairly likely)?

Thanks all,