简体   繁体   English

如何使用TT模板访问EF对象

[英]How to access EF objects using the TT templates

I have the myModel.edmx with one table. 我有一张桌子的myModel.edmx。 I am used to work with the auto-generated entities. 我习惯于使用自动生成的实体。 Now I am trying the new TT option, but I can't understand where are the objects? 现在,我正在尝试新的TT选项,但无法理解对象在哪里?

I want to execute a query, but cant find object_name 我想执行查询,但是找不到object_name

db.ExecuteQuery<object_name >

TT files are not accessing EF objects, but reading the xmlfile(edmx), the is used to create the objects we'll use to get and set data to database. TT文件不访问EF对象,而是读取xmlfile(edmx),用于创建对象,我们将使用这些对象来获取数据并将其设置为数据库。

TT Files on this case are used to generate automatically objects. 在这种情况下,TT文件用于自动生成对象。

For your question you have to take a better look to the xmlformat of edmx file to help you understand, how objects are generated and how to call explicitelly that function 对于您的问题,您必须更好地了解edmx文件的xmlformat,以帮助您了解如何生成对象以及如何显式调用该函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带有TT模板的EF6 Guid返回null - EF6 With TT Templates Guid is returning null 如何通过编辑T4 .tt模板自动向具有特定属性(列名称)的EF数据库首先生成的实体添加接口 - How do I automatically add interfaces to EF database first generated entities that have specific properties (column names) by editing T4 .tt templates 如何使用.tt模板创建文件夹? - How to create a folder using .tt template? 如何重新运行扩展名为t4而不是tt的t4模板 - How to re-run t4 templates that have a t4 extension instead of tt 如何在 Visual Studio 2015 上的 ASP.NET 核心中创建 T4 文本模板(.tt) - How to create T4 text templates(.tt) in ASP.NET core on Visual Studio 2015 如何使用存储库模式将 EF 对象转换为 WCF 模型 - How to transform EF Objects to WCF Models using Repository pattern 生成类似于EF tt文件的类文件 - Generating class files similar to EF tt files 如何使用EF联接两个数据传输对象(DTO)? [编辑] - How to join two Data Transfer Objects (DTOs) using EF? [Edited] 使用EF对象上的GetProperties()查找连接的对象 - Find connected objects using GetProperties() on EF objects 如何使用存储库模式访问EF中的导航属性 - How to access navigation properties in EF using repository pattern
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM