This project is read-only.

Enhancements ideas

Feb 22, 2011 at 2:18 PM

Hi all

Thanks a lot for this great implmentation of Templates using Razor.

I have some problem testing my templates, it's rather complicated to understand the error messages without having the code that has been generated. Would it be possible to add it in the TemplateCompilationException ?

I would like to be able to use a syntax like the "@model" in MVC 3 to specify the type of the Model in the template. This would ease the specification of the Model type for Included Templates.

Keep up the good work !





Feb 22, 2011 at 3:18 PM

I've added support for the @model declaration in a branch. Whether or not we'll see that in the main is up for grabs simply because we'd be repeating functionality of the MVC razor engine, which is something we're not keen to do. However, my implementation only works in design mode and doesn't affect the actual type passed in by the engine itself - though now that I think about it, it could be used to validate you're passing in the right model....hmm...

Feb 22, 2011 at 10:50 PM

Thanks for quick feedback.

I understand that you don't want to repeat every functionality of the MVC engine. But if the support of the @model directive is enough to increase intelisense in VS, it's could greatly improve template creation/debugging.



Feb 23, 2011 at 10:49 PM

Agreed. That's why I wrote it in the first place. I'm still figuring out how it's going to work but I think it will be a dynamic system where we can add any @namegoeshere support that can be overridden by the parser when people write their own templatebase type. Still up in the air :)