开发者

Adding my template to the list of code generation items in Studio 2010

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜