This project is read-only.

Adding a suffix to generated class names

Feb 19, 2014 at 3:37 PM
Hi,

I use RazorGenerator.MsBuild to precompile MVC views. I wonder if it is possible to add suffix to generated class names. When I have a view 'Invoice.cshtml' and a model 'Invoice' it won't compile, becase the generated class looks like this:
public partial class Invoice : Hypos.CRM.ViewPage<Invoice>
{
}
Can I change class name to InvoiceViewPage or something similar?

Thank you!

Dusan
Feb 19, 2014 at 6:38 PM
You could stick a directive at the top of the file to do this:
// MyView.cshtml
@* ClassSuffix: Foo *@
If you want to do this for all files in the folder, you could write a file named "razorgenerator.directives" with the directive:
ClassSuffix: Foo
Some of the other supported directives are specified on the project home page - https://razorgenerator.codeplex.com/
Marked as answer by djanosik on 2/19/2014 at 11:59 AM
Feb 19, 2014 at 7:58 PM
Ok, thank you!