T4 custom code blocks

久未见 提交于 2019-12-11 02:57:44

问题


With T4 can you have custom code blocks, that should not be overwritten at generation? Like PreserveExistingFile but for a block of code in the generated file. I can’t use partial class in my scenario


回答1:


There's no way to do this. You should either include unmodifiable code blocks in the template itself, or read them from another file.



来源:https://stackoverflow.com/questions/4546715/t4-custom-code-blocks

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!