I have taken the POCO tt templates that can be used in Studio 2010 with Entity Framework and modified them to better fit my needs.开发者_开发技巧 I have added a few things to make testing easier.
Now I want to be able to right click on the entity framework design surface, choose "Add Code Generation Item" and select my templates instead of the built in POCO ones so that I can use them more easily.
Where do I need to start to make this happen? Any examples anyone can point me to?
You can replace the template files on the disk.
They are stored at:
%program files%\Microsoft Visual Studio 10.0\Common7\IDE\
under the directories ItemTemplates and ItemTemlatesCache (one is zip files and the other is what the IDE has open).
They have names that all start with "AdoNetEntityDataModelT4". You can replace the templates in the zip files (under ItemTemplates) and on disk (in ItemTemplatesCache). Search around and you'll be able to find the template you wish to change.
精彩评论