Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我真的必须添加代码生成项并将生成的 POCO 再次复制到我的类库吗?
显然,这将成为快速变化的数据模型的巨大障碍。有没有一种自动化的方式来解决这个问题(内置方式)?
将模板移动到另一个类库后,您必须手动触发其更新。使用 .tt 文件的上下文菜单并选择运行自定义工具。
将 .tt 文件移动(不要复制)到其他程序集,然后对其进行编辑并将“输入文件”路径更改为从该程序集目录到 edmx 所在位置的相对路径。
要更新,请右键单击、运行自定义工具或打开 .tt 文件并保存。