简体   繁体   English

ASP.Net ado.net 问题 EDMX Entity Framework

[英]ASP.Net ado.net problem EDMX Entity Framework

I want to create an ADO.NET model for Azure Database and it creates with success but I can't see the models.我想为 Azure 数据库创建 ADO.NET model 并成功创建,但我看不到模型。

This is how it looks in Visual Studio:这是它在 Visual Studio 中的外观:

EDMX 模型

And still in my folder the models are created but I don't see them.仍然在我的文件夹中创建了模型,但我没有看到它们。

Can you help me?你能帮助我吗?

我的模型文件夹

The EDMX is a representation of the model - but you have to run the.tt files in order for them to analyze your EDMX to create the model. EDMX 是 model 的代表 - 但您必须运行 .tt 文件才能让他们分析您的 EDMX 以创建 model。

UPDATE: The.tt file should be under the.edmx file in your Solution Explorer.更新: .tt 文件应位于解决方案资源管理器中的 .edmx 文件下。

To do this, right-click the.tt and chose to Run (can't remember exactly what the command is) but it will execute your changes to the EDMX and create the various.cs or.vb classes for you.为此,请右键单击 .tt 并选择运行(不记得确切的命令是什么),但它会执行您对 EDMX 的更改并为您创建各种.cs 或.vb 类。 In your case, it's the Employee.Context.tt file that you need to run/execute.在您的情况下,它是您需要运行/执行的 Employee.Context.tt 文件。

Be careful if you change the generated.cs or.vb files that are created, as if you re-run the.tt file, it'll drop and recreate your code, potentially losing any customisations.如果您更改已创建的 generated.cs 或 .vb 文件,请小心,就像您重新运行 .tt 文件一样,它会删除并重新创建您的代码,可能会丢失任何自定义。

UPDATE: I've found you this really good explanation of each stage which might help.更新:我发现你对每个阶段都有很好的解释,这可能会有所帮助。

Hope this helps.希望这可以帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM