自定义代码生成策略? [英] Custom Code Generation Strategy?

查看:115
本文介绍了自定义代码生成策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为数据库代码生成创建了自定义数据库生成工作流,效果很好。

(对于任何有兴趣的人,我都跟随'开发人''D3'应用的主角:
http://blogs.msdn.com/ dsimmons /存档/ 2009/06/30 / D3建设伟大的软件 - 是 - 一 - 战斗 - 唐叔离开,任何资产上最sidelines.aspx
我想为代码生成做同样的事情 - 有这样的事情吗?我知道我可以创建T4脚本并将它们附加到edmx文件中,但是我想进一步实现它C#代码被触发,主要是为了与VS进行更深入的集成,例如自动检出等。我看到这可以在db gen端完成工作流活动,但代码生成方面的东西是否相同能否?或者我最好只是坚持现有的数据库生成工作流程这样的事情?

谢谢!

脊柱


Hi,
I created a custom Database Generation Workflow for database code generation and it works great.

(For anyone interested, I followed the lead of the 'dev guy's 'D3' app:
(http://blogs.msdn.com/dsimmons/archive/2009/06/30/d3-building-great-software-is-a-battle-don-t-leave-any-assets-on-the-sidelines.aspx)

I would like to do the same thing for the Code generation - is there such a thing? I know i can create T4 scripts and attach them to the edmx file, but I'd like to go one further and have actual C# code triggered, primarily to do more in-depth integration with VS, such as automatic check-outs, etc. I see this can be done on the db gen side with workflow activities, but does the  code generation side of things have the same capability? Or am I best off just sticking to the existing database generation workflow for this kind of thing?

Thanks!

Spinal


推荐答案

没有用于代码生成的工作流程,但您可以调用从T4模板中编写的任意代码。我不确定你是否可以获得一个可视化工作室DTE对象,但不应该花很长时间尝试。
There isn't a workflow for code generation, but you can call out to arbitrary code that you write from within the T4 template. I am not sure if you can get a visual studio DTE object, but it shouldn't take long to try.


这篇关于自定义代码生成策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆