在代码生成的设计时读取实体 [英] Reading Entities at Design Time for Code Gen
问题描述
我想构建一个Visual Studio加载项,它根据EF实体模型生成代码(服务调用,UI等)。
谁能告诉我在设计时阅读EF实体模型的最简单方法是什么?
谢谢!
嗨*,
可能你只对模型的CSDL部分感兴趣。考虑到,EDMX文件只是XML文件,那么我认为LINQ to XML是最简单的方法。要获得CSDL,您可以重复使用代码,例如 http://blog.vyvojar.cz/jirka/archive/2009/01/25/mapping-stored-procedures-that-are-returning-non-entity-result-在-edm.aspx 。
I want to build a Visual Studio add-in that generates code (service calls, UI, etc) based on an EF entity model.
Can anyone tell me what's the easiest way to read the EF entity model at design time to do this?
Thanks!
Hi *,
probably you're only interested in CSDL part of model. Taking into account, that EDMX file is justXML file, then I think LINQ to XML is easiest way. To get CSDL you may re-use code used i.e. in http://blog.vyvojar.cz/jirka/archive/2009/01/25/mapping-stored-procedures-that-are-returning-non-entity-result-in-edm.aspx.
这篇关于在代码生成的设计时读取实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!