T4 generation of resource names as constants?
I don't like ma开发者_StackOverflow社区gic strings in my validator attributes when I use resources as message templates.
Is it possible to get T4 generation of constants of resource names?
theres the t4mvc project which will convert strings to constants for you in an mvc project im not sure if you are using mvc or not but you can look at the way its done in their t4 templates and apply it to your project
I've found this T4 template: http://blog.baltrinic.com/software-development/dotnet/t4-template-replace-resxfilecodegenerator
It needed some chages to work but seems ok right now.
精彩评论