开发者

How to handle POCO refresh in class library?

开发者 https://www.devze.com 2023-02-23 03:24 出处:网络
Created POCOs using Self-Tracking Entities template Copied .tt file with POCOs to class library Added new table to database
  1. Created POCOs using Self-Tracking Entities template
  2. Copied .tt file with POCOs to class library
  3. Added new table to database
  4. Refreshed edmx file
  5. Now开发者_高级运维 what?

Do I really have to Add Code Generation Item and copy the generated POCOs to my class library again?

Obviously this will become a huge hindrance in a fast changing data model. Is there an automated way to solve this (built in way)?


Once you move a template to another class library you must trigger its update manually. Use context menu on .tt file and select Run custom tool.


Move (do not copy) the .tt file to other assembly, then edit it and change "inputfile" path to relative path from that assembly's directory to where the edmx is.

To update, right click, run custom tool or open .tt file and save.

0

精彩评论

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