I looked through a lot of the code that is generated by the tool and traced the problem all the way to the
MyController.generated.cs
file:public class ActionNamesClass { public readonly string Index = "Index"; public readonly string Edit = "Edit"; public readonly string Create = "Create"; }
Great now I have to edit the way the code is generated... or do I?
Solution
Turns out David Ebbo has thought of everything! There is a setting in theT4MVC.settings.t4
file specifically for that, which I just need to set to true:// If true, use lower case tokens in routes for the area, controller and action names const bool UseLowercaseRoutes = true;
Now when I look at the generated code in my
MyController.generated.cs
file I can see:public class ActionNamesClass { public readonly string Index = ("Index").ToLowerInvariant(); public readonly string Edit = ("Edit").ToLowerInvariant(); public readonly string Create = ("Create").ToLowerInvariant(); }
Lovely.
Great Tip man, Thanks =D
ReplyDelete