strongly typed views?

Sep 28, 2012 at 4:35 PM

Does razorengine support strongly typed templates?  From the getting started docs it appears that the provided models are always anonymous.

In contrast, when I'm working in an full-blown MVC project I can put

@model MyProject.Entities.Dog

at the top of my view and then my IDE is smart enough to suggest properties of the Dog type as I write my code.

What about partial views?  There's a lot of nice features I'm used to using from MVC3 that would be great to use with razorengine. 

Great work by the way!  I spent the morning looking for a way to to razor without MVC and this project appears to be the best solution so far

Thanks,

Peter

Oct 3, 2012 at 10:27 AM
Edited Oct 3, 2012 at 10:28 AM

Hi Peter,

 

Does this help you? https://github.com/Antaris/RazorEngine/wiki/Intellisense-and-ReSharper.

Specifically in the example here a custom Template derives from TemplateBase<T> with a strongly typed model version:

@inherits MyCustomizedTemplate<InvoiceModel>
Oct 3, 2012 at 2:37 PM

Thank markchivs!  This is exactly what I needed!