开发者

T4 generation of resource names as constants?

开发者 https://www.devze.com 2023-03-02 11:16 出处:网络
I don\'t like ma开发者_StackOverflow社区gic strings in my validator attributes when I use resources as message templates.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号