我怎样才能创建单独的SSDL + CSDL + MSL文件并没有EDMX的ObjectContext的? [英] How can I create an ObjectContext from separate ssdl + csdl + msl files and no edmx?

查看:264
本文介绍了我怎样才能创建单独的SSDL + CSDL + MSL文件并没有EDMX的ObjectContext的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设:


  1. 一个空的C#项目

  2. 3宽松的文件:一个SSDL,CSDL和MSL(在其他地方产生)

  3. 没有EDMX文件

什么修改/添加我应该项目执行这些文件编译成一个基于T4-ObjectContext的(例如,使用T4波苏斯发电机)...

What modifications/additions should I perform on project to compile these files into a T4-based ObjectContext (e.g. using POCOs T4 generators)...


  1. 如果我已经有了所有为实体生成的类?

  2. 如果我没有为实体生成的类?

将它更容易产生ObjectContext中和或类,如果我第一个文件合并成一个EDMX没有设计节?

Would it be easier to generate the ObjectContext and or classes if I first combine the files into an EDMX with no Designer section?

推荐答案

工作液:

生成SSDL,CSDL,MSL文件,包括项目作为嵌入式资源

Generate SSDL, CSDL, MSL files and include in project as embedded resources.

结合生成EDMX 。这些文件和包括项目T4S看

Generate EDMX by combining those files and include in project for T4s to look at.

在修改App.Config中EF的连接字符串:添加组件的默认命名空间('。'+)$ b $在b之前资源'的文件名。

Modify EF's connection string in App.Config: add default namespace of assembly (+ '.') before resources' file names.

点T4在EDMX和改造的模板。

Point T4 at EDMX and transform templates.

这篇关于我怎样才能创建单独的SSDL + CSDL + MSL文件并没有EDMX的ObjectContext的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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